1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:10:04 -07:00

crypto/x509: fix incorrect prints found by govet

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4526073
This commit is contained in:
Robert Hencke 2011-05-22 09:23:22 +10:00 committed by Rob Pike
parent f4fe688b09
commit 6dced6d992

View File

@ -313,7 +313,7 @@ func TestParseCertificateWithDSASignatureAlgorithm(t *testing.T) {
pemBlock, _ := pem.Decode([]byte(dsaCertPem)) pemBlock, _ := pem.Decode([]byte(dsaCertPem))
cert, err := ParseCertificate(pemBlock.Bytes) cert, err := ParseCertificate(pemBlock.Bytes)
if err != nil { if err != nil {
t.Fatal("Failed to parse certificate: %s", err) t.Fatalf("Failed to parse certificate: %s", err)
} }
if cert.SignatureAlgorithm != DSAWithSHA1 { if cert.SignatureAlgorithm != DSAWithSHA1 {
t.Errorf("Parsed signature algorithm was not DSAWithSHA1") t.Errorf("Parsed signature algorithm was not DSAWithSHA1")
@ -324,10 +324,10 @@ func TestVerifyCertificateWithDSASignature(t *testing.T) {
pemBlock, _ := pem.Decode([]byte(dsaCertPem)) pemBlock, _ := pem.Decode([]byte(dsaCertPem))
cert, err := ParseCertificate(pemBlock.Bytes) cert, err := ParseCertificate(pemBlock.Bytes)
if err != nil { if err != nil {
t.Fatal("Failed to parse certificate: %s", err) t.Fatalf("Failed to parse certificate: %s", err)
} }
// test cert is self-signed // test cert is self-signed
if err = cert.CheckSignatureFrom(cert); err != nil { if err = cert.CheckSignatureFrom(cert); err != nil {
t.Fatal("DSA Certificate verfication failed: %s", err) t.Fatalf("DSA Certificate verfication failed: %s", err)
} }
} }