forked from quic-go/quic-go
fix error handling in the TLS crypto setup
There are two ways that an error can occur during the handshake: 1. as a return value from qtls.Handshake() 2. when new data is passed to the crypto setup via HandleData() We need to make sure that the RunHandshake() as well as HandleData() both return if an error occurs at any step during the handshake.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type cryptoDataHandler interface {
|
||||
HandleData([]byte, protocol.EncryptionLevel) error
|
||||
HandleData([]byte, protocol.EncryptionLevel)
|
||||
}
|
||||
|
||||
type cryptoStreamManager struct {
|
||||
@@ -48,8 +48,6 @@ func (m *cryptoStreamManager) HandleCryptoFrame(frame *wire.CryptoFrame, encLeve
|
||||
if data == nil {
|
||||
return nil
|
||||
}
|
||||
if err := m.cryptoHandler.HandleData(data, encLevel); err != nil {
|
||||
return err
|
||||
}
|
||||
m.cryptoHandler.HandleData(data, encLevel)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user