Skip to content

Commit

Permalink
pyln: Sets remote_pubkey for LightningConnection if node is not the i…
Browse files Browse the repository at this point in the history
…nitiator

Currently ``LightningConnection.remote_pubkey`` is set to ``None`` if the node is not the handshake initiator. This sets it to ``rs`` in act three from the receiver side
  • Loading branch information
sr-gi authored and rustyrussell committed Sep 12, 2020
1 parent 26c10ff commit f1d5fdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/pyln-proto/pyln/proto/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ def handshake_act_three_responder(self, m):
raise ValueError("Unsupported handshake version {}, only version "
"0 is supported.".format(v))
rs = decryptWithAD(self.temp_k2, self.nonce(1), h.digest(), c)
self.remote_pubkey = PublicKey(rs)
h.update(c)
se = ecdh(self.handshake['e'], PublicKey(rs))
se = ecdh(self.handshake['e'], self.remote_pubkey)

self.chaining_key, self.temp_k3 = hkdf_two_keys(
se.raw, self.chaining_key
Expand Down

0 comments on commit f1d5fdf

Please sign in to comment.