From 1d2a976597b02692faeba9242bb23d8458c0110a Mon Sep 17 00:00:00 2001 From: mhchia Date: Tue, 18 Feb 2020 22:55:48 +0800 Subject: [PATCH] Remove TODOs --- libp2p/security/noise/transport.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libp2p/security/noise/transport.py b/libp2p/security/noise/transport.py index 5ee3ba5..80bb6ee 100644 --- a/libp2p/security/noise/transport.py +++ b/libp2p/security/noise/transport.py @@ -16,6 +16,10 @@ class Transport(ISecureTransport): local_peer: ID early_data: bytes with_noise_pipes: bool + + # NOTE: Implementations that support Noise Pipes must decide whether to use + # an XX or IK handshake based on whether they possess a cached static + # Noise key for the remote peer. # TODO: A storage of seen noise static keys for pattern IK? def __init__( @@ -46,15 +50,9 @@ class Transport(ISecureTransport): ) async def secure_inbound(self, conn: IRawConnection) -> ISecureConn: - # TODO: SecureInbound attempts to complete a noise-libp2p handshake initiated - # by a remote peer over the given InsecureConnection. pattern = self.get_pattern() return await pattern.handshake_inbound(conn) async def secure_outbound(self, conn: IRawConnection, peer_id: ID) -> ISecureConn: - # TODO: Validate libp2p pubkey with `peer_id`. Abort if not correct. - # NOTE: Implementations that support Noise Pipes must decide whether to use - # an XX or IK handshake based on whether they possess a cached static - # Noise key for the remote peer. pattern = self.get_pattern() return await pattern.handshake_outbound(conn, peer_id)