mirror of https://github.com/golang/go.git
crypto/tls, crypto/x509: update spelling of marshal*
Per https://golang.org/wiki/Spelling and CL 33017. Change-Id: Ia813a81d25603883114c4e4b6997eb560d6a3690 Reviewed-on: https://go-review.googlesource.com/c/go/+/172457 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
parent
7cdacf558f
commit
431b5c69ca
|
|
@ -320,7 +320,7 @@ func (m *clientHelloMsg) marshalWithoutBinders() []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateBinders updates the m.pskBinders field, if necessary updating the
|
// updateBinders updates the m.pskBinders field, if necessary updating the
|
||||||
// cached marshalled representation. The supplied binders must have the same
|
// cached marshaled representation. The supplied binders must have the same
|
||||||
// length as the current m.pskBinders.
|
// length as the current m.pskBinders.
|
||||||
func (m *clientHelloMsg) updateBinders(pskBinders [][]byte) {
|
func (m *clientHelloMsg) updateBinders(pskBinders [][]byte) {
|
||||||
if len(pskBinders) != len(m.pskBinders) {
|
if len(pskBinders) != len(m.pskBinders) {
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ func MarshalPKCS8PrivateKey(key interface{}) ([]byte, error) {
|
||||||
case *ecdsa.PrivateKey:
|
case *ecdsa.PrivateKey:
|
||||||
oid, ok := oidFromNamedCurve(k.Curve)
|
oid, ok := oidFromNamedCurve(k.Curve)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("x509: unknown curve while marshalling to PKCS#8")
|
return nil, errors.New("x509: unknown curve while marshaling to PKCS#8")
|
||||||
}
|
}
|
||||||
|
|
||||||
oidBytes, err := asn1.Marshal(oid)
|
oidBytes, err := asn1.Marshal(oid)
|
||||||
|
|
@ -100,7 +100,7 @@ func MarshalPKCS8PrivateKey(key interface{}) ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("x509: unknown key type while marshalling PKCS#8: %T", key)
|
return nil, fmt.Errorf("x509: unknown key type while marshaling PKCS#8: %T", key)
|
||||||
}
|
}
|
||||||
|
|
||||||
return asn1.Marshal(privKey)
|
return asn1.Marshal(privKey)
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ func TestPKCS8(t *testing.T) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !bytes.Equal(derBytes, reserialised) {
|
if !bytes.Equal(derBytes, reserialised) {
|
||||||
t.Errorf("%s: marshalled PKCS#8 didn't match original: got %x, want %x", test.name, reserialised, derBytes)
|
t.Errorf("%s: marshaled PKCS#8 didn't match original: got %x, want %x", test.name, reserialised, derBytes)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue