lnd/brontide
Olaoluwa Osuntokun c64811a5f3
brontide: set read deadlines on socket during initial handshake
This commit fixes a lingering issue within lnd, which can cause a
server to freeze up, and not handle any incoming connections properly,
or cause clients to freeze and not return in a timely manner from a
failed connection attempt.

To avoid this, each time we need to read from the socket during the
initial brontide handshake, we add a 15 second read deadline. If we
don’t successfully read from the buffer during that time frame, then
the Read method will return a timeout error.

With this in place, we ensure that the main listener goroutine will
never be blocked waiting on a remote party to write ActOne.
2017-10-04 14:58:20 -07:00
..
conn.go brontide: set read deadlines on socket during initial handshake 2017-10-04 14:58:20 -07:00
listener.go brontide: set read deadlines on socket during initial handshake 2017-10-04 14:58:20 -07:00
noise_test.go brontide: add a test case to exercise all BOLT-0008 test vectors 2017-08-01 17:18:05 -07:00
noise.go brontide: add EphemeralGenerator as a functional arg to NewBrontideMachine 2017-08-01 17:16:36 -07:00
README.md multi: fix formatting issues in packge README's 2017-03-27 16:25:25 -07:00

brontide

Build Status MIT licensed GoDoc

The brontide package implements a secure crypto messaging protocol based off of the Noise Protocol Framework. The package exposes the raw state machine that handles the handshake and subsequent message encryption/decryption scheme. Additionally, the package exposes a net.Conn and a net.Listener interface implementation which allows the encrypted transport to be seamlessly integrated into a codebase.

The secure messaging scheme implemented within this package is described in detail in BOLT #8 of the Lightning Network specifications.

This package has intentionally been designed so it can be used as a standalone package for any projects needing secure encrypted+authenticated communications between network enabled programs.

Installation and Updating

$ go get -u github.com/lightningnetwork/lnd/brontide