Extend logging when peer handshake detects clashing/same keys
Tor Arne Vestbø committed
Apr 7, 2015 at 13:19 UTC
0bb4df9d3b72d3ec3618690ed6ff6b34aa2af283
1 file changed
+2
p2p/crypto/secio/protocol.go
+2
@@ -248,6 +248,8 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
248
k1, k2 = k2, k1 // swap
249
default:
250
log.Error("WOAH: same keys (AND same nonce: 1/(2^128) chance!).")
251
+ log.Errorf("k1: %v, k2: %v, insecure: %v, insecureM %v", k1, k2, s.insecure, s.insecureM)
252
+
253
// this shouldn't happen. must determine order another way.
254
// use the same keys but, make sure to copy underlying data!
255
copy(k2.IV, k1.IV)