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
这个提交包含在:
父节点
956950bb13
当前提交
000416e795
@ -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)
|
||||
|
||||
|
9
prf.go
9
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
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户