From 1dc278ed6ce80f014ebc975a7752a14c897dd330 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 15 May 2017 12:16:54 +0200 Subject: [PATCH] noise_test: use 32-byte psk The noise spec mandates 256-bit preshared keys. Signed-off-by: Jason A. Donenfeld --- noise_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/noise_test.go b/noise_test.go index 7cb8960..a7277c9 100644 --- a/noise_test.go +++ b/noise_test.go @@ -256,13 +256,13 @@ func (NoiseSuite) TestPSK_NN_Roundtrip(c *C) { Random: rngI, Pattern: HandshakeNN, Initiator: true, - PresharedKey: []byte("supersecret"), + PresharedKey: []byte("supersecretsupersecretsupersecre"), }) hsR := NewHandshakeState(Config{ CipherSuite: cs, Random: rngR, Pattern: HandshakeNN, - PresharedKey: []byte("supersecret"), + PresharedKey: []byte("supersecretsupersecretsupersecre"), }) // -> e @@ -302,7 +302,7 @@ func (NoiseSuite) TestPSK_N(c *C) { Random: rng, Pattern: HandshakeN, Initiator: true, - PresharedKey: []byte{0x01, 0x02, 0x03}, + PresharedKey: []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20}, PeerStatic: staticR.Public, }) @@ -324,7 +324,7 @@ func (NoiseSuite) TestPSK_X(c *C) { Random: rng, Pattern: HandshakeX, Initiator: true, - PresharedKey: []byte{0x01, 0x02, 0x03}, + PresharedKey: []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20}, StaticKeypair: staticI, PeerStatic: staticR.Public, }) @@ -341,7 +341,7 @@ func (NoiseSuite) TestPSK_NN(c *C) { rngR := new(RandomInc) *rngR = 1 prologue := []byte{0x01, 0x02, 0x03} - psk := []byte{0x04, 0x05, 0x06} + psk := []byte{0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23} hsI := NewHandshakeState(Config{ CipherSuite: cs, @@ -384,7 +384,7 @@ func (NoiseSuite) TestPSK_XX(c *C) { staticI := cs.GenerateKeypair(rngI) staticR := cs.GenerateKeypair(rngR) prologue := []byte{0x01, 0x02, 0x03} - psk := []byte{0x04, 0x05, 0x06} + psk := []byte{0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23} hsI := NewHandshakeState(Config{ CipherSuite: cs,