summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 14:47:31 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 14:47:31 +0200
commit7f1c9d1cc2131c49f6b77e90f050caf331df6179 (patch)
treef49b1cc76bfd0def3c60fe5bf602c683fe2d5654
parent021724a535592e43c4f0e3d3c60ae416b4776a5c (diff)
Fix noise test
-rw-r--r--noise_test.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/noise_test.go b/noise_test.go
index 8e1bd89..b165c0f 100644
--- a/noise_test.go
+++ b/noise_test.go
@@ -102,17 +102,19 @@ func TestNoiseHandshake(t *testing.T) {
t.Log("deriving keys")
- key1 := peer1.BeginSymmetricSession()
- key2 := peer2.BeginSymmetricSession()
-
- if key1 == nil {
- t.Fatal("failed to dervice keypair for peer 1")
+ err = peer1.BeginSymmetricSession()
+ if err != nil {
+ t.Fatal("failed to derive keypair for peer 1", err)
}
- if key2 == nil {
- t.Fatal("failed to dervice keypair for peer 2")
+ err = peer2.BeginSymmetricSession()
+ if err != nil {
+ t.Fatal("failed to derive keypair for peer 2", err)
}
+ key1 := peer1.keypairs.next
+ key2 := peer2.keypairs.current
+
// encrypting / decryption test
t.Log("test key pairs")