Class: HrrRbSsh::Authentication::Method::KeyboardInteractive::InfoResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ InfoResponse

Returns a new instance of InfoResponse.



15
16
17
18
19
20
21
22
23
24
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb', line 15

def initialize payload
  case payload[0,1].unpack("C")[0]
  when Message::SSH_MSG_USERAUTH_INFO_RESPONSE::VALUE
    message = Message::SSH_MSG_USERAUTH_INFO_RESPONSE.decode payload
    @num_responses = message[:'num-responses']
    @responses = Array.new(message[:'num-responses']){ |i| message[:"response[#{i+1}]"] }
  else
    raise "Expected SSH_MSG_USERAUTH_INFO_RESPONSE, but got message number #{payload[0,1].unpack("C")[0]}"
  end
end

Instance Attribute Details

#num_responsesObject (readonly)

Returns the value of attribute num_responses.



11
12
13
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb', line 11

def num_responses
  @num_responses
end

#responsesObject (readonly)

Returns the value of attribute responses.



11
12
13
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb', line 11

def responses
  @responses
end