Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
ca5b43ed
Commit
ca5b43ed
authored
Apr 07, 2015
by
Tor Arne Vestbø
Browse files
Extend logging when peer handshake detects clashing/same keys
parent
44309cd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
crypto/secio/protocol.go
View file @
ca5b43ed
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment