Simplify getting a hostinfo or starting a handshake with one (#954)

This commit is contained in:
Nate Brown 2023-08-21 18:51:45 -05:00 committed by GitHub
parent 7edcf620c0
commit 076ebc6c6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 158 additions and 215 deletions

View file

@ -23,14 +23,12 @@ type ConnectionState struct {
initiator bool
messageCounter atomic.Uint64
window *Bits
queueLock sync.Mutex
writeLock sync.Mutex
ready bool
}
func NewConnectionState(l *logrus.Logger, cipher string, certState *CertState, initiator bool, pattern noise.HandshakePattern, psk []byte, pskStage int) *ConnectionState {
var dhFunc noise.DHFunc
switch certState.Certificate.Details.Curve {
case cert.Curve_CURVE25519:
dhFunc = noise.DH25519