mirror of https://github.com/waku-org/noise.git
added XXfallback handshake, getters for local and peer ephemeral (#28)
This commit is contained in:
parent
953535c65f
commit
d1c47b3565
|
@ -98,6 +98,15 @@ var HandshakeXX = HandshakePattern{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var HandshakeXXfallback = HandshakePattern{
|
||||||
|
Name: "XXfallback",
|
||||||
|
Messages: [][]MessagePattern{
|
||||||
|
{MessagePatternE},
|
||||||
|
{MessagePatternE, MessagePatternDHEE, MessagePatternS, MessagePatternDHSE},
|
||||||
|
{MessagePatternS, MessagePatternDHES},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
var HandshakeIX = HandshakePattern{
|
var HandshakeIX = HandshakePattern{
|
||||||
Name: "IX",
|
Name: "IX",
|
||||||
Messages: [][]MessagePattern{
|
Messages: [][]MessagePattern{
|
||||||
|
|
13
state.go
13
state.go
|
@ -495,3 +495,16 @@ func (s *HandshakeState) PeerStatic() []byte {
|
||||||
func (s *HandshakeState) MessageIndex() int {
|
func (s *HandshakeState) MessageIndex() int {
|
||||||
return s.msgIdx
|
return s.msgIdx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PeerEphemeral returns the ephemeral key provided by the remote peer during
|
||||||
|
// a handshake. It is an error to call this method if a handshake message
|
||||||
|
// containing a static key has not been read.
|
||||||
|
func (s *HandshakeState) PeerEphemeral() []byte {
|
||||||
|
return s.re
|
||||||
|
}
|
||||||
|
|
||||||
|
// LocalEphemeral returns the local ephemeral key pair generated during
|
||||||
|
// a handshake.
|
||||||
|
func (s *HandshakeState) LocalEphemeral() DHKey {
|
||||||
|
return s.e
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue