remove the error return value when receiving TLS extensions

This commit is contained in:
Marten Seemann
2019-02-07 12:43:29 +08:00
parent 89c7f628ca
commit 26afc7a4ca
7 changed files with 18 additions and 25 deletions

View File

@@ -862,16 +862,15 @@ func getCertsFromEntries(certEntries []certificateEntry) [][]byte {
return certs
}
func (hs *clientHandshakeState) processEncryptedExtensions(ee *encryptedExtensionsMsg) error {
func (hs *clientHandshakeState) processEncryptedExtensions(ee *encryptedExtensionsMsg) {
c := hs.c
if ee.alpnProtocol != "" {
c.clientProtocol = ee.alpnProtocol
c.clientProtocolFallback = false
}
if hs.c.config.ReceivedExtensions != nil {
return hs.c.config.ReceivedExtensions(typeEncryptedExtensions, ee.additionalExtensions)
hs.c.config.ReceivedExtensions(typeEncryptedExtensions, ee.additionalExtensions)
}
return nil
}
func verifyPeerHandshakeSignature(
@@ -1037,9 +1036,7 @@ func (hs *clientHandshakeState) doTLS13Handshake() error {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(encryptedExtensions, msg)
}
if err := hs.processEncryptedExtensions(encryptedExtensions); err != nil {
return err
}
hs.processEncryptedExtensions(encryptedExtensions)
hs.keySchedule.write(encryptedExtensions.marshal())
// PSKs are not supported, so receive Certificate message.

View File

@@ -631,7 +631,7 @@ type Config struct {
// Currently only implemented for the ClientHello message (sent by the
// client) and for the EncryptedExtensions message (sent by the server).
// Only valid for TLS 1.3.
ReceivedExtensions func(handshakeMessageType uint8, exts []Extension) error
ReceivedExtensions func(handshakeMessageType uint8, exts []Extension)
serverInitOnce sync.Once // guards calling (*Config).serverInit

View File

@@ -261,10 +261,7 @@ Curves:
hs.hello.compressionMethod = compressionNone
} else {
if hs.c.config.ReceivedExtensions != nil {
if err := hs.c.config.ReceivedExtensions(typeClientHello, hs.clientHello.additionalExtensions); err != nil {
c.sendAlert(alertInternalError)
return false, err
}
hs.c.config.ReceivedExtensions(typeClientHello, hs.clientHello.additionalExtensions)
}
hs.hello = new(serverHelloMsg)
hs.hello13Enc = new(encryptedExtensionsMsg)