Noise: complete handshake process

TODO
- Figure out why `state.rs` is erased at some moment(even handshake
is not done).
- Refactor
- Add tests
This commit is contained in:
mhchia
2020-02-16 00:42:49 +08:00
parent 8a4ebd4cbb
commit d0290d2b5a
6 changed files with 176 additions and 24 deletions

View File

@ -38,7 +38,12 @@ class Transport(ISecureTransport):
if self.with_noise_pipes:
raise NotImplementedError
else:
return PatternXX(self.local_peer, self.libp2p_privkey, self.noise_privkey)
return PatternXX(
self.local_peer,
self.libp2p_privkey,
self.noise_privkey,
self.early_data,
)
async def secure_inbound(self, conn: IRawConnection) -> ISecureConn:
# TODO: SecureInbound attempts to complete a noise-libp2p handshake initiated