lib/noise/connection/base.rb in noise-ruby-0.7.3 vs lib/noise/connection/base.rb in noise-ruby-0.7.4
- old
+ new
@@ -1,13 +1,14 @@
# frozen_string_literal: true
module Noise
module Connection
class Base
- attr_reader :protocol, :handshake_started, :handshake_finished, :handshake_hash
+ attr_reader :protocol, :handshake_started, :handshake_finished, :handshake_hash, :handshake_state
attr_reader :cipher_state_encrypt, :cipher_state_decrypt, :cipher_state_handshake
attr_accessor :psks, :prologue
+ attr_reader :s, :rs
def initialize(name, keypairs: { s: nil, e: nil, rs: nil, re: nil })
@protocol = Protocol.create(name)
@keypairs = keypairs
@@ -101,9 +102,11 @@
@protocol.is_psk_handshake
end
def handshake_done(_c1, _c2)
@handshake_hash = @symmetric_state.handshake_hash
+ @s = @handshake_state.s
+ @rs = @handshake_state.rs
@handshake_state = nil
@symmetric_state = nil
@cipher_state_handshake = nil
end
end