Commit 1dc278ed authored by Jason A. Donenfeld's avatar Jason A. Donenfeld

noise_test: use 32-byte psk

The noise spec mandates 256-bit preshared keys.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
parent 5d56e55c
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment