mirror of
https://github.com/logos-messaging/noise.git
synced 2026-01-07 08:33:12 +00:00
Copy PeerEphemeral to avoid buffer corruption
This commit is contained in:
parent
3881dc9640
commit
82839267d3
5
state.go
5
state.go
@ -151,11 +151,14 @@ func NewHandshakeState(c Config) *HandshakeState {
|
||||
s: c.StaticKeypair,
|
||||
e: c.EphemeralKeypair,
|
||||
rs: c.PeerStatic,
|
||||
re: c.PeerEphemeral,
|
||||
messagePatterns: c.Pattern.Messages,
|
||||
shouldWrite: c.Initiator,
|
||||
rng: c.Random,
|
||||
}
|
||||
if len(c.PeerEphemeral) > 0 {
|
||||
hs.re = make([]byte, len(c.PeerEphemeral))
|
||||
copy(hs.re, c.PeerEphemeral)
|
||||
}
|
||||
hs.SymmetricState.cs = c.CipherSuite
|
||||
namePrefix := "Noise_"
|
||||
if len(c.PresharedKey) > 0 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user