diff options
author | zelig <viktor.tron@gmail.com> | 2015-01-20 08:41:45 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-02-06 07:00:35 +0800 |
commit | 923504ce3df504a843cfa775d577ac99bdbfdb70 (patch) | |
tree | 53691b607f7e1c07707adc01c8581d0037ba4080 | |
parent | 2e868566d7f4c97bd4a92c4943919ed52a55e9b1 (diff) | |
download | dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.tar dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.tar.gz dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.tar.bz2 dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.tar.lz dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.tar.xz dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.tar.zst dexon-923504ce3df504a843cfa775d577ac99bdbfdb70.zip |
add equality check for nonce and remote nonce
-rw-r--r-- | p2p/crypto_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
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") } |