From 0bb4df9d3b72d3ec3618690ed6ff6b34aa2af283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 7 Apr 2015 13:19:00 +0200 Subject: [PATCH] Extend logging when peer handshake detects clashing/same keys --- p2p/crypto/secio/protocol.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2p/crypto/secio/protocol.go b/p2p/crypto/secio/protocol.go index a8d9a9203..4242e2d54 100644 --- a/p2p/crypto/secio/protocol.go +++ b/p2p/crypto/secio/protocol.go @@ -248,6 +248,8 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e k1, k2 = k2, k1 // swap default: log.Error("WOAH: same keys (AND same nonce: 1/(2^128) chance!).") + log.Errorf("k1: %v, k2: %v, insecure: %v, insecureM %v", k1, k2, s.insecure, s.insecureM) + // this shouldn't happen. must determine order another way. // use the same keys but, make sure to copy underlying data! copy(k2.IV, k1.IV)