handle Retry packets in the session

This commit is contained in:
Marten Seemann
2019-02-02 12:44:43 +08:00
parent 7a7e7ca6eb
commit 17f4ebad64
11 changed files with 199 additions and 194 deletions

View File

@@ -199,6 +199,16 @@ func newCryptoSetup(
return cs, cs.clientHelloWrittenChan, nil
}
func (h *cryptoSetup) ChangeConnectionID(id protocol.ConnectionID) error {
initialSealer, initialOpener, err := NewInitialAEAD(id, h.perspective)
if err != nil {
return err
}
h.initialSealer = initialSealer
h.initialOpener = initialOpener
return nil
}
func (h *cryptoSetup) RunHandshake() error {
// Handle errors that might occur when HandleData() is called.
handshakeErrChan := make(chan error, 1)

View File

@@ -32,6 +32,7 @@ type tlsExtensionHandler interface {
type CryptoSetup interface {
RunHandshake() error
io.Closer
ChangeConnectionID(protocol.ConnectionID) error
HandleMessage([]byte, protocol.EncryptionLevel) bool
ConnectionState() ConnectionState