diff options
Diffstat (limited to 'src/pkg/crypto')
| -rw-r--r-- | src/pkg/crypto/tls/handshake_client.go | 8 | ||||
| -rw-r--r-- | src/pkg/crypto/x509/x509.go | 16 | ||||
| -rw-r--r-- | src/pkg/crypto/x509/x509_test.go | 10 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/pkg/crypto/tls/handshake_client.go b/src/pkg/crypto/tls/handshake_client.go index d07e2d89f..8cc6b7409 100644 --- a/src/pkg/crypto/tls/handshake_client.go +++ b/src/pkg/crypto/tls/handshake_client.go @@ -34,11 +34,11 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<- finishedHash := newFinishedHash() hello := &clientHelloMsg{ - major: defaultMajor, - minor: defaultMinor, - cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + major: defaultMajor, + minor: defaultMinor, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, compressionMethods: []uint8{compressionNone}, - random: make([]byte, 32), + random: make([]byte, 32), } currentTime := uint32(config.Time()) diff --git a/src/pkg/crypto/x509/x509.go b/src/pkg/crypto/x509/x509.go index 5b526de4d..886a5e7dc 100644 --- a/src/pkg/crypto/x509/x509.go +++ b/src/pkg/crypto/x509/x509.go @@ -74,11 +74,11 @@ func ParsePKCS1PrivateKey(der []byte) (key *rsa.PrivateKey, err os.Error) { func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte { priv := pkcs1PrivateKey{ Version: 1, - N: asn1.RawValue{Tag: 2, Bytes: key.PublicKey.N.Bytes()}, - E: key.PublicKey.E, - D: asn1.RawValue{Tag: 2, Bytes: key.D.Bytes()}, - P: asn1.RawValue{Tag: 2, Bytes: key.P.Bytes()}, - Q: asn1.RawValue{Tag: 2, Bytes: key.Q.Bytes()}, + N: asn1.RawValue{Tag: 2, Bytes: key.PublicKey.N.Bytes()}, + E: key.PublicKey.E, + D: asn1.RawValue{Tag: 2, Bytes: key.D.Bytes()}, + P: asn1.RawValue{Tag: 2, Bytes: key.P.Bytes()}, + Q: asn1.RawValue{Tag: 2, Bytes: key.Q.Bytes()}, } b, _ := asn1.MarshalToMemory(priv) @@ -787,9 +787,9 @@ func CreateCertificate(rand io.Reader, template, parent *Certificate, priv *rsa. Version: 3, SerialNumber: asn1.RawValue{Bytes: template.SerialNumber, Tag: 2}, SignatureAlgorithm: algorithmIdentifier{oidSHA1WithRSA}, - Issuer: parent.Subject.toRDNSequence(), - Validity: validity{template.NotBefore, template.NotAfter}, - Subject: template.Subject.toRDNSequence(), + Issuer: parent.Subject.toRDNSequence(), + Validity: validity{template.NotBefore, template.NotAfter}, + Subject: template.Subject.toRDNSequence(), PublicKey: publicKeyInfo{algorithmIdentifier{oidRSA}, encodedPublicKey}, Extensions: extensions, } diff --git a/src/pkg/crypto/x509/x509_test.go b/src/pkg/crypto/x509/x509_test.go index e0ae37736..85e9e1bc8 100644 --- a/src/pkg/crypto/x509/x509_test.go +++ b/src/pkg/crypto/x509/x509_test.go @@ -160,18 +160,18 @@ func TestCreateSelfSignedCertificate(t *testing.T) { template := Certificate{ SerialNumber: []byte{1}, Subject: Name{ - CommonName: "test.example.com", + CommonName: "test.example.com", Organization: "Acme Co", }, NotBefore: time.SecondsToUTC(1000), - NotAfter: time.SecondsToUTC(100000), + NotAfter: time.SecondsToUTC(100000), SubjectKeyId: []byte{1, 2, 3, 4}, - KeyUsage: KeyUsageCertSign, + KeyUsage: KeyUsageCertSign, BasicConstraintsValid: true, - IsCA: true, - DNSNames: []string{"test.example.com"}, + IsCA: true, + DNSNames: []string{"test.example.com"}, } derBytes, err := CreateCertificate(urandom, &template, &template, priv) |
