[dev.boringcrypto] all: merge master into dev.boringcrypto

Change-Id: I31c69e54c904c66c10920e4c4caacfef08bb834f
This commit is contained in:
Dmitri Shuralyov 2020-12-01 17:16:25 -05:00
commit dea96ada17
21 changed files with 236 additions and 419 deletions

View file

@ -400,11 +400,17 @@ func (hs *clientHandshakeStateTLS13) readServerParameters() error {
}
hs.transcript.Write(encryptedExtensions.marshal())
if len(encryptedExtensions.alpnProtocol) != 0 && len(hs.hello.alpnProtocols) == 0 {
c.sendAlert(alertUnsupportedExtension)
return errors.New("tls: server advertised unrequested ALPN extension")
if encryptedExtensions.alpnProtocol != "" {
if len(hs.hello.alpnProtocols) == 0 {
c.sendAlert(alertUnsupportedExtension)
return errors.New("tls: server advertised unrequested ALPN extension")
}
if mutualProtocol([]string{encryptedExtensions.alpnProtocol}, hs.hello.alpnProtocols) == "" {
c.sendAlert(alertUnsupportedExtension)
return errors.New("tls: server selected unadvertised ALPN protocol")
}
c.clientProtocol = encryptedExtensions.alpnProtocol
}
c.clientProtocol = encryptedExtensions.alpnProtocol
return nil
}