Use atomic.Pointer for certState (#833)

This commit is contained in:
Nate Brown
2023-03-30 13:04:09 -05:00
committed by GitHub
parent 2801fb2286
commit 6b3d42efa5
5 changed files with 12 additions and 11 deletions

View File

@@ -33,7 +33,7 @@ func (f *Interface) newConnectionState(l *logrus.Logger, initiator bool, pattern
cs = noise.NewCipherSuite(noise.DH25519, noise.CipherChaChaPoly, noise.HashSHA256)
}
curCertState := f.certState
curCertState := f.certState.Load()
static := noise.DHKey{Private: curCertState.privateKey, Public: curCertState.publicKey}
b := NewBits(ReplayWindow)