mirror of
https://github.com/logos-messaging/noise.git
synced 2026-01-07 08:33:12 +00:00
noise_test: use 32-byte psk
The noise spec mandates 256-bit preshared keys. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
5d56e55c10
commit
1dc278ed6c
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user