diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-23 13:41:59 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-23 13:41:59 +0200 |
commit | 50aeefcb5198d99777e19f9a0100fe74af630dfb (patch) | |
tree | 5e8924cde01e586fcb1f7168946bee46528d70c9 /src/noise_test.go | |
parent | 1868d15914d6cd7cd57b90b7644b008ec16361b9 (diff) |
Beginning work noise handshake
Diffstat (limited to 'src/noise_test.go')
-rw-r--r-- | src/noise_test.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/noise_test.go b/src/noise_test.go new file mode 100644 index 0000000..b3ea54f --- /dev/null +++ b/src/noise_test.go @@ -0,0 +1,38 @@ +package main + +import ( + "testing" +) + +func TestHandshake(t *testing.T) { + var dev1 Device + var dev2 Device + + var err error + + dev1.privateKey, err = newPrivateKey() + if err != nil { + t.Fatal(err) + } + + dev2.privateKey, err = newPrivateKey() + if err != nil { + t.Fatal(err) + } + + var peer1 Peer + var peer2 Peer + + peer1.publicKey = dev1.privateKey.publicKey() + peer2.publicKey = dev2.privateKey.publicKey() + + var handshake1 Handshake + var handshake2 Handshake + + handshake1.device = &dev1 + handshake2.device = &dev2 + + handshake1.peer = &peer2 + handshake2.peer = &peer1 + +} |