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 https://golang.org/cl/224062
This commit is contained in:
parent
956950bb13
commit
000416e795
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package tls
|
package tls
|
||||||
|
|
||||||
import "strings"
|
|
||||||
|
|
||||||
type clientHelloMsg struct {
|
type clientHelloMsg struct {
|
||||||
raw []byte
|
raw []byte
|
||||||
major, minor uint8
|
major, minor uint8
|
||||||
@ -100,7 +98,7 @@ func (m *clientHelloMsg) marshal() []byte {
|
|||||||
z[1] = 1
|
z[1] = 1
|
||||||
z[3] = byte(len(m.serverName) >> 8)
|
z[3] = byte(len(m.serverName) >> 8)
|
||||||
z[4] = byte(len(m.serverName))
|
z[4] = byte(len(m.serverName))
|
||||||
copy(z[5:], strings.Bytes(m.serverName))
|
copy(z[5:], []byte(m.serverName))
|
||||||
z = z[l:]
|
z = z[l:]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +278,7 @@ func (m *serverHelloMsg) marshal() []byte {
|
|||||||
l = 255
|
l = 255
|
||||||
}
|
}
|
||||||
z[0] = byte(l)
|
z[0] = byte(l)
|
||||||
copy(z[1:], strings.Bytes(v[0:l]))
|
copy(z[1:], []byte(v[0:l]))
|
||||||
z = z[1+l:]
|
z = z[1+l:]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -548,7 +546,7 @@ func (m *nextProtoMsg) marshal() []byte {
|
|||||||
|
|
||||||
y := x[4:]
|
y := x[4:]
|
||||||
y[0] = byte(l)
|
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 = y[1+l:]
|
||||||
y[0] = byte(padding)
|
y[0] = byte(padding)
|
||||||
|
|
||||||
|
9
prf.go
9
prf.go
@ -10,7 +10,6 @@ import (
|
|||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"hash"
|
"hash"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Split a premaster secret in two as specified in RFC 4346, section 5.
|
// 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.
|
finishedVerifyLength = 12 // Length of verify_data in a Finished message.
|
||||||
)
|
)
|
||||||
|
|
||||||
var masterSecretLabel = strings.Bytes("master secret")
|
var masterSecretLabel = []byte("master secret")
|
||||||
var keyExpansionLabel = strings.Bytes("key expansion")
|
var keyExpansionLabel = []byte("key expansion")
|
||||||
var clientFinishedLabel = strings.Bytes("client finished")
|
var clientFinishedLabel = []byte("client finished")
|
||||||
var serverFinishedLabel = strings.Bytes("server finished")
|
var serverFinishedLabel = []byte("server finished")
|
||||||
|
|
||||||
// keysFromPreMasterSecret generates the connection keys from the pre master
|
// keysFromPreMasterSecret generates the connection keys from the pre master
|
||||||
// secret, given the lengths of the MAC and cipher keys, as defined in RFC
|
// secret, given the lengths of the MAC and cipher keys, as defined in RFC
|
||||||
|
Loading…
Reference in New Issue
Block a user