add equality check for nonce and remote nonce
This commit is contained in:
parent
2e868566d7
commit
923504ce3d
@ -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)
|
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) {
|
if !bytes.Equal(initSessionToken, recSessionToken) {
|
||||||
t.Errorf("session tokens do not match")
|
t.Errorf("session tokens do not match")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user