Class: Noise::Connection::Responder

Inherits:
Base
  • Object
show all
Defined in:
lib/noise/connection/responder.rb

Instance Attribute Summary

Attributes inherited from Base

#cipher_state_decrypt, #cipher_state_encrypt, #cipher_state_handshake, #handshake_finished, #handshake_hash, #handshake_started, #handshake_state, #prologue, #protocol, #psks, #rs, #s

Instance Method Summary collapse

Methods inherited from Base

#decrypt, #encrypt, #initialise_handshake_state, #psk_handshake?, #read_message, #start_handshake, #valid_keypairs?, #validate, #validate_psk!, #write_message

Constructor Details

#initialize(name, keypairs: { s: nil, e: nil, rs: nil, re: nil }) ⇒ Responder

Returns a new instance of Responder.



6
7
8
9
# File 'lib/noise/connection/responder.rb', line 6

def initialize(name, keypairs: { s: nil, e: nil, rs: nil, re: nil })
  super
  @next_message = :read
end

Instance Method Details

#handshake_done(c1, c2) ⇒ Object



15
16
17
18
19
# File 'lib/noise/connection/responder.rb', line 15

def handshake_done(c1, c2)
  super
  @cipher_state_decrypt = c1
  @cipher_state_encrypt = @protocol.pattern.one_way ? nil : c2
end

#initiator?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/noise/connection/responder.rb', line 11

def initiator?
  false
end