X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fgovpn%2Fpeer_test.go;h=40f6b1d4970210c8e6d0ccd45d4a2629ac24110d;hb=b34ab62244f364d754c7db601af65d5e0a0a88a7;hp=4e6f5879e5596ab72a01fc071927e39df932be2d;hpb=af08408334c3e2f23acde5f74e77f628c85b532a;p=govpn.git diff --git a/src/govpn/peer_test.go b/src/govpn/peer_test.go index 4e6f587..40f6b1d 100644 --- a/src/govpn/peer_test.go +++ b/src/govpn/peer_test.go @@ -71,10 +71,27 @@ func TestSymmetric(t *testing.T) { } } -func TestSymmetricEncLess(t *testing.T) { +func TestSymmetricNoise(t *testing.T) { peerd := newPeer(true, "foo", Dummy{nil}, conf, new([SSize]byte)) peer.NoiseEnable = true + peerd.NoiseEnable = true + f := func(payload []byte) bool { + if len(payload) == 0 { + return true + } + peer.EthProcess(payload) + return peerd.PktProcess(ciphertext, Dummy{nil}, true) + } + if err := quick.Check(f, nil); err != nil { + t.Error(err) + } + peer.NoiseEnable = true +} + +func TestSymmetricEncLess(t *testing.T) { + peerd := newPeer(true, "foo", Dummy{nil}, conf, new([SSize]byte)) peer.EncLess = true + peer.NoiseEnable = true peerd.EncLess = true peerd.NoiseEnable = true f := func(payload []byte) bool {