summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/tls
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-02-25 16:01:29 -0800
committerRuss Cox <rsc@golang.org>2010-02-25 16:01:29 -0800
commit454796815f7f2e0e614b999f9cc1ef0e3e093b78 (patch)
treea0a5f67e4a643d3bdadd4e28cee9b0900401b62d /src/pkg/crypto/tls
parent975cc91983c054595b22502d7b9271a3d3cb828e (diff)
downloadgolang-454796815f7f2e0e614b999f9cc1ef0e3e093b78.tar.gz
strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
Diffstat (limited to 'src/pkg/crypto/tls')
-rw-r--r--src/pkg/crypto/tls/handshake_messages.go8
-rw-r--r--src/pkg/crypto/tls/prf.go9
2 files changed, 7 insertions, 10 deletions
diff --git a/src/pkg/crypto/tls/handshake_messages.go b/src/pkg/crypto/tls/handshake_messages.go
index 10d2ba3e2..966314857 100644
--- a/src/pkg/crypto/tls/handshake_messages.go
+++ b/src/pkg/crypto/tls/handshake_messages.go
@@ -4,8 +4,6 @@
package tls
-import "strings"
-
type clientHelloMsg struct {
raw []byte
major, minor uint8
@@ -100,7 +98,7 @@ func (m *clientHelloMsg) marshal() []byte {
z[1] = 1
z[3] = byte(len(m.serverName) >> 8)
z[4] = byte(len(m.serverName))
- copy(z[5:], strings.Bytes(m.serverName))
+ copy(z[5:], []byte(m.serverName))
z = z[l:]
}
@@ -280,7 +278,7 @@ func (m *serverHelloMsg) marshal() []byte {
l = 255
}
z[0] = byte(l)
- copy(z[1:], strings.Bytes(v[0:l]))
+ copy(z[1:], []byte(v[0:l]))
z = z[1+l:]
}
}
@@ -548,7 +546,7 @@ func (m *nextProtoMsg) marshal() []byte {
y := x[4:]
y[0] = byte(l)
- copy(y[1:], strings.Bytes(m.proto[0:l]))
+ copy(y[1:], []byte(m.proto[0:l]))
y = y[1+l:]
y[0] = byte(padding)
diff --git a/src/pkg/crypto/tls/prf.go b/src/pkg/crypto/tls/prf.go
index 6b9c44c07..ee6cb780b 100644
--- a/src/pkg/crypto/tls/prf.go
+++ b/src/pkg/crypto/tls/prf.go
@@ -10,7 +10,6 @@ import (
"crypto/sha1"
"hash"
"os"
- "strings"
)
// Split a premaster secret in two as specified in RFC 4346, section 5.
@@ -70,10 +69,10 @@ const (
finishedVerifyLength = 12 // Length of verify_data in a Finished message.
)
-var masterSecretLabel = strings.Bytes("master secret")
-var keyExpansionLabel = strings.Bytes("key expansion")
-var clientFinishedLabel = strings.Bytes("client finished")
-var serverFinishedLabel = strings.Bytes("server finished")
+var masterSecretLabel = []byte("master secret")
+var keyExpansionLabel = []byte("key expansion")
+var clientFinishedLabel = []byte("client finished")
+var serverFinishedLabel = []byte("server finished")
// keysFromPreMasterSecret generates the connection keys from the pre master
// secret, given the lengths of the MAC and cipher keys, as defined in RFC