Browse Source

brontide: fix typo

master
yyforyongyu 3 years ago
parent
commit
e06768e4eb
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
  1. 12
      brontide/conn.go
  2. 8
      brontide/listener.go
  3. 4
      brontide/noise.go

12
brontide/conn.go

@ -62,8 +62,8 @@ func Dial(local keychain.SingleKeyECDH, netAddr *lnwire.NetAddress,
}
// We'll ensure that we get ActTwo from the remote peer in a timely
// manner. If they don't respond within 1s, then we'll kill the
// connection.
// manner. If they don't respond within handshakeReadTimeout, then
// we'll kill the connection.
err = conn.SetReadDeadline(time.Now().Add(handshakeReadTimeout))
if err != nil {
b.conn.Close()
@ -229,7 +229,7 @@ func (c *Conn) Flush() (int, error) {
return c.noise.Flush(c.conn)
}
// Close closes the connection. Any blocked Read or Write operations will be
// Close closes the connection. Any blocked Read or Write operations will be
// unblocked and return errors.
//
// Part of the net.Conn interface.
@ -261,7 +261,7 @@ func (c *Conn) SetDeadline(t time.Time) error {
return c.conn.SetDeadline(t)
}
// SetReadDeadline sets the deadline for future Read calls. A zero value for t
// SetReadDeadline sets the deadline for future Read calls. A zero value for t
// means Read will not time out.
//
// Part of the net.Conn interface.
@ -269,9 +269,9 @@ func (c *Conn) SetReadDeadline(t time.Time) error {
return c.conn.SetReadDeadline(t)
}
// SetWriteDeadline sets the deadline for future Write calls. Even if write
// SetWriteDeadline sets the deadline for future Write calls. Even if write
// times out, it may return n > 0, indicating that some of the data was
// successfully written. A zero value for t means Write will not time out.
// successfully written. A zero value for t means Write will not time out.
//
// Part of the net.Conn interface.
func (c *Conn) SetWriteDeadline(t time.Time) error {

8
brontide/listener.go

@ -115,8 +115,8 @@ func (l *Listener) doHandshake(conn net.Conn) {
}
// We'll ensure that we get ActOne from the remote peer in a timely
// manner. If they don't respond within 1s, then we'll kill the
// connection.
// manner. If they don't respond within handshakeReadTimeout, then
// we'll kill the connection.
err := conn.SetReadDeadline(time.Now().Add(handshakeReadTimeout))
if err != nil {
brontideConn.conn.Close()
@ -160,8 +160,8 @@ func (l *Listener) doHandshake(conn net.Conn) {
}
// We'll ensure that we get ActTwo from the remote peer in a timely
// manner. If they don't respond within 1 second, then we'll kill the
// connection.
// manner. If they don't respond within handshakeReadTimeout, then
// we'll kill the connection.
err = conn.SetReadDeadline(time.Now().Add(handshakeReadTimeout))
if err != nil {
brontideConn.conn.Close()

4
brontide/noise.go

@ -252,7 +252,7 @@ func (s *symmetricState) EncryptAndHash(plaintext []byte) []byte {
}
// DecryptAndHash returns the authenticated decryption of the passed
// ciphertext. When encrypting the handshake digest (h) is used as the
// ciphertext. When encrypting the handshake digest (h) is used as the
// associated data to the AEAD cipher.
func (s *symmetricState) DecryptAndHash(ciphertext []byte) ([]byte, error) {
plaintext, err := s.Decrypt(s.handshakeDigest[:], nil, ciphertext)
@ -870,7 +870,7 @@ func (b *Machine) ReadHeader(r io.Reader) (uint32, error) {
// ReadBody attempts to ready the next message body from the passed io.Reader.
// The provided buffer MUST be the length indicated by the packet length
// returned by the preceding call to ReadHeader. In the case of an
// authentication eerror, a non-nil error is returned.
// authentication error, a non-nil error is returned.
func (b *Machine) ReadBody(r io.Reader, buf []byte) ([]byte, error) {
// Next, using the length read from the packet header, read the
// encrypted packet itself into the buffer allocated by the read

Loading…
Cancel
Save