crypto/tls: don't rely on map iteration order.

Previously we were using the map iteration order to set the order of
the cipher suites in the ClientHello.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5440048
This commit is contained in:
Adam Langley 2011-11-28 15:34:16 -05:00
parent 5f6027e9ad
commit 1eb7ca924b
4 changed files with 33 additions and 22 deletions

View file

@ -315,9 +315,7 @@ var (
func initDefaultCipherSuites() {
varDefaultCipherSuites = make([]uint16, len(cipherSuites))
i := 0
for id := range cipherSuites {
varDefaultCipherSuites[i] = id
i++
for i, suite := range cipherSuites {
varDefaultCipherSuites[i] = suite.id
}
}