forked from quic-go/quic-go
Merge pull request #2225 from lucas-clemente/handshake-done
implement the HANDSHAKE_DONE mechanism
This commit is contained in:
@@ -221,13 +221,6 @@ func (h *cryptoSetup) ChangeConnectionID(id protocol.ConnectionID) {
|
||||
|
||||
func (h *cryptoSetup) SetLargest1RTTAcked(pn protocol.PacketNumber) {
|
||||
h.aead.SetLargestAcked(pn)
|
||||
// drop handshake keys
|
||||
if h.handshakeOpener != nil {
|
||||
h.handshakeOpener = nil
|
||||
h.handshakeSealer = nil
|
||||
h.logger.Debugf("Dropping Handshake keys.")
|
||||
h.runner.DropKeys(protocol.EncryptionHandshake)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *cryptoSetup) RunHandshake() {
|
||||
@@ -563,6 +556,21 @@ func (h *cryptoSetup) dropInitialKeys() {
|
||||
h.logger.Debugf("Dropping Initial keys.")
|
||||
}
|
||||
|
||||
func (h *cryptoSetup) DropHandshakeKeys() {
|
||||
var dropped bool
|
||||
h.mutex.Lock()
|
||||
if h.handshakeOpener != nil {
|
||||
h.handshakeOpener = nil
|
||||
h.handshakeSealer = nil
|
||||
dropped = true
|
||||
}
|
||||
h.mutex.Unlock()
|
||||
if dropped {
|
||||
h.runner.DropKeys(protocol.EncryptionHandshake)
|
||||
h.logger.Debugf("Dropping Handshake keys.")
|
||||
}
|
||||
}
|
||||
|
||||
func (h *cryptoSetup) GetInitialSealer() (LongHeaderSealer, error) {
|
||||
h.mutex.Lock()
|
||||
defer h.mutex.Unlock()
|
||||
|
||||
@@ -73,6 +73,7 @@ type CryptoSetup interface {
|
||||
|
||||
HandleMessage([]byte, protocol.EncryptionLevel) bool
|
||||
SetLargest1RTTAcked(protocol.PacketNumber)
|
||||
DropHandshakeKeys()
|
||||
ConnectionState() tls.ConnectionState
|
||||
|
||||
GetInitialOpener() (LongHeaderOpener, error)
|
||||
|
||||
Reference in New Issue
Block a user