Commit 1a072f4b authored by Adam Langley's avatar Adam Langley

crypto/tls: commit fixes which I hadn't saved.

R=rsc
CC=golang-dev
https://golang.org/cl/3685041
parent 976e4572
...@@ -16,9 +16,11 @@ import ( ...@@ -16,9 +16,11 @@ import (
// function. All cipher suites currently assume RSA key agreement. // function. All cipher suites currently assume RSA key agreement.
type cipherSuite struct { type cipherSuite struct {
// the lengths, in bytes, of the key material needed for each component. // the lengths, in bytes, of the key material needed for each component.
keyLen, macLen, ivLen int keyLen int
cipher func(key, iv []byte, isRead bool) interface{} macLen int
mac func(macKey []byte) hash.Hash ivLen int
cipher func(key, iv []byte, isRead bool) interface{}
mac func(macKey []byte) hash.Hash
} }
var cipherSuites = map[uint16]*cipherSuite{ var cipherSuites = map[uint16]*cipherSuite{
...@@ -47,7 +49,7 @@ func hmacSHA1(key []byte) hash.Hash { ...@@ -47,7 +49,7 @@ func hmacSHA1(key []byte) hash.Hash {
// ciphersuites and the id requested by the peer. // ciphersuites and the id requested by the peer.
func mutualCipherSuite(have []uint16, want uint16) (suite *cipherSuite, id uint16) { func mutualCipherSuite(have []uint16, want uint16) (suite *cipherSuite, id uint16) {
for _, id := range have { for _, id := range have {
if want == id { if id == want {
return cipherSuites[id], id return cipherSuites[id], id
} }
} }
......
...@@ -147,7 +147,7 @@ func (c *Config) rootCAs() *CASet { ...@@ -147,7 +147,7 @@ func (c *Config) rootCAs() *CASet {
func (c *Config) cipherSuites() []uint16 { func (c *Config) cipherSuites() []uint16 {
s := c.CipherSuites s := c.CipherSuites
if len(s) == 0 { if s == nil {
s = defaultCipherSuites() s = defaultCipherSuites()
} }
return s return s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment