From 2e868566d7f4c97bd4a92c4943919ed52a55e9b1 Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 20 Jan 2015 00:23:10 +0000 Subject: add minor comments to the test --- p2p/crypto_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'p2p') diff --git a/p2p/crypto_test.go b/p2p/crypto_test.go index fb7df6b50..33cdb3f83 100644 --- a/p2p/crypto_test.go +++ b/p2p/crypto_test.go @@ -25,10 +25,14 @@ func TestCryptoHandshake(t *testing.T) { } // simulate handshake by feeding output to input + // initiator sends handshake 'auth' auth, initNonce, randomPrivKey, _, _ := initiator.startHandshake(receiver.pubKeyDER, sessionToken) + // receiver reads auth and responds with response response, remoteRecNonce, remoteInitNonce, remoteRandomPrivKey, _ := receiver.respondToHandshake(auth, crypto.FromECDSAPub(pub0), sessionToken) + // initiator reads receiver's response and the key exchange completes recNonce, remoteRandomPubKey, _, _ := initiator.completeHandshake(response) + // now both parties should have the same session parameters initSessionToken, initSecretRW, _ := initiator.newSession(initNonce, recNonce, auth, randomPrivKey, remoteRandomPubKey) recSessionToken, recSecretRW, _ := receiver.newSession(remoteInitNonce, remoteRecNonce, auth, remoteRandomPrivKey, &randomPrivKey.PublicKey) -- cgit v1.2.3