Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn is a net.Conn that implements a framed Noise protocol on top of the underlying net.Conn provided in NewConn. Conn allows for 0-RTT protocols, in the sense that bytes given to Write will be added to handshake payloads. Read and Write should not be called concurrently until HandshakeComplete() is true.
func NewConnWithOptions ¶
NewConn wraps an existing net.Conn with encryption provided by noise.Config and options provided by Options.
func (*Conn) HandshakeComplete ¶
HandshakeComplete returns whether a handshake is complete.
func (*Conn) HandshakeHash ¶
HandshakeHash returns the hash generated by the handshake which can be used for channel identification and channel binding. This returns nil until the handshake is completed.
func (*Conn) PeerStatic ¶
PeerStatic returns the static key of the peer, as soon as it is known.
type Listener ¶
func NewListenerWithOptions ¶
type MessageInspector ¶
MessageInspector is a callback that gets informed about unparsed Noise messages.
type Options ¶
type Options struct { // ResponderFirstMessageValidator will be called with the first // received Noise message (unparsed) for a responder, if set. It is // not considered for initiators or for any subsequent packet. // This can be used for analyzing message replay, debouncing // messages deliberately sent twice // (see github.com/jtolio/noiseconn/debounce), and other issues, // but is not safe for use as replay attack prevention. ResponderFirstMessageValidator MessageInspector }