lib/gssapi/simple.rb
def unwrap_message(msg, encrypted = true)
      min_stat = FFI::MemoryPointer.new :OM_uint32
      in_buff = GSSAPI::LibGSSAPI::UnManagedGssBufferDesc.new
      in_buff.value = msg
      out_buff = GSSAPI::LibGSSAPI::ManagedGssBufferDesc.new
      conf_state = FFI::MemoryPointer.new :int
      conf_state.write_int((encrypted ? 1 : 0))
      q_op = FFI::MemoryPointer.new :OM_uint32
      q_op.write_int(0)
      maj_stat = GSSAPI::LibGSSAPI.gss_unwrap(min_stat, @context, in_buff.pointer, out_buff.pointer, conf_state, q_op)
      raise GssApiError.new(maj_stat, min_stat), "Failed to gss_unwrap message" if maj_stat != 0
      out_buff.value
    end
# Unwrap a message previously wrapped with gss_wrap.
# @param [String] msg The message to unwrap
# @param [Boolean] encrypted Whether or not this message was encrypted (true) or just signed (false)
Unwrap a message previously wrapped with gss_wrap.
Unwrap a message previously wrapped with gss_wrap .
def unwrap_message(msg, encrypted = true)
      min_stat = FFI::MemoryPointer.new :OM_uint32
      in_buff = GSSAPI::LibGSSAPI::UnManagedGssBufferDesc.new
      in_buff.value = msg
      out_buff = GSSAPI::LibGSSAPI::ManagedGssBufferDesc.new
      conf_state = FFI::MemoryPointer.new :int
      conf_state.write_int((encrypted ? 1 : 0))
      q_op = FFI::MemoryPointer.new :OM_uint32
      q_op.write_int(0)
      maj_stat = GSSAPI::LibGSSAPI.gss_unwrap(min_stat, @context, in_buff.pointer, out_buff.pointer, conf_state, q_op)
      raise GssApiError.new(maj_stat, min_stat), "Failed to gss_unwrap message" if maj_stat != 0
      out_buff.value
    end
def unwrap_message ( msg , encrypted = true ) min_stat = FFI :: MemoryPointer . new :OM_uint32 in_buff = GSSAPI :: LibGSSAPI :: UnManagedGssBufferDesc . new in_buff . value = msg out_buff = GSSAPI :: LibGSSAPI :: ManagedGssBufferDesc . new conf_state = FFI :: MemoryPointer . new :int conf_state . write_int ( ( encrypted ? 1 : 0 ) ) q_op = FFI :: MemoryPointer . new :OM_uint32 q_op . write_int ( 0 ) maj_stat = GSSAPI :: LibGSSAPI . gss_unwrap ( min_stat , @context , in_buff . pointer , out_buff . pointer , conf_state , q_op ) raise GssApiError . new ( maj_stat , min_stat ) , "Failed to gss_unwrap message" if maj_stat != 0 out_buff . value end
Unwrap a message previously wrapped with gss_wrap.
Unwrap a message previously wrapped with gss_wrap .
msg
encrypted
encrypted Whether or not this message was encrypted (true) or just signed (false)
encrypted Whether or not this message was encrypted ( true ) or just signed ( false )