From 923504ce3df504a843cfa775d577ac99bdbfdb70 Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 20 Jan 2015 00:41:45 +0000 Subject: add equality check for nonce and remote nonce --- p2p/crypto_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/p2p/crypto_test.go b/p2p/crypto_test.go index 33cdb3f83..89baca084 100644 --- a/p2p/crypto_test.go +++ b/p2p/crypto_test.go @@ -38,6 +38,12 @@ func TestCryptoHandshake(t *testing.T) { fmt.Printf("%x\n%x\n%x\n%x\n%x\n%x\n%x\n%x\n%x\n%x\n", auth, initNonce, response, remoteRecNonce, remoteInitNonce, remoteRandomPubKey, recNonce, &randomPrivKey.PublicKey, initSessionToken, initSecretRW) + if !bytes.Equal(initNonce, remoteInitNonce) { + t.Errorf("nonces do not match") + } + if !bytes.Equal(recNonce, remoteRecNonce) { + t.Errorf("receiver nonces do not match") + } if !bytes.Equal(initSessionToken, recSessionToken) { t.Errorf("session tokens do not match") } -- cgit v1.2.3