]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: commit fixes which I hadn't saved.
authorAdam Langley <agl@golang.org>
Wed, 15 Dec 2010 18:58:57 +0000 (13:58 -0500)
committerAdam Langley <agl@golang.org>
Wed, 15 Dec 2010 18:58:57 +0000 (13:58 -0500)
R=rsc
CC=golang-dev
https://golang.org/cl/3685041

src/pkg/crypto/tls/cipher_suites.go
src/pkg/crypto/tls/common.go

index c376c58898e9c7cea85629f79c00b72382fcff7a..87a9f836bfcc8c35c978f44c800e133296541cb6 100644 (file)
@@ -16,9 +16,11 @@ import (
 // function. All cipher suites currently assume RSA key agreement.
 type cipherSuite struct {
        // the lengths, in bytes, of the key material needed for each component.
-       keyLen, macLen, ivLen int
-       cipher                func(key, iv []byte, isRead bool) interface{}
-       mac                   func(macKey []byte) hash.Hash
+       keyLen int
+       macLen int
+       ivLen  int
+       cipher func(key, iv []byte, isRead bool) interface{}
+       mac    func(macKey []byte) hash.Hash
 }
 
 var cipherSuites = map[uint16]*cipherSuite{
@@ -47,7 +49,7 @@ func hmacSHA1(key []byte) hash.Hash {
 // ciphersuites and the id requested by the peer.
 func mutualCipherSuite(have []uint16, want uint16) (suite *cipherSuite, id uint16) {
        for _, id := range have {
-               if want == id {
+               if id == want {
                        return cipherSuites[id], id
                }
        }
index 1cb2d850ccdd1872e2de604cd89a80531a41bfda..6df4264a21ff9d72f79504432a2a99d90f276393 100644 (file)
@@ -147,7 +147,7 @@ func (c *Config) rootCAs() *CASet {
 
 func (c *Config) cipherSuites() []uint16 {
        s := c.CipherSuites
-       if len(s) == 0 {
+       if s == nil {
                s = defaultCipherSuites()
        }
        return s