Commit 82839267 authored by Jonathan Rudenberg's avatar Jonathan Rudenberg

Copy PeerEphemeral to avoid buffer corruption

parent 3881dc96
......@@ -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 {
......
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