1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:20:22 -07:00

crypto/tls: select best ciphersuite, not worst.

Previously, the outer loop would continue until we selected the
client's least preferable ciphersuite.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4029056
This commit is contained in:
Adam Langley 2011-02-05 13:56:36 -05:00
parent 566d432f54
commit ab2aca5e52

View File

@ -57,6 +57,7 @@ Curves:
var suite *cipherSuite
var suiteId uint16
FindCipherSuite:
for _, id := range clientHello.cipherSuites {
for _, supported := range config.cipherSuites() {
if id == supported {
@ -67,7 +68,7 @@ Curves:
continue
}
suiteId = id
break
break FindCipherSuite
}
}
}