From ae62792d5213e0ab9f315067d4e3dab008e78001 Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Wed, 6 May 2015 16:47:27 -0700 Subject: [PATCH] actually use them --- ca/certificate-authority_test.go | 4 ++-- ra/registration-authority_test.go | 2 +- sa/storage-authority.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ca/certificate-authority_test.go b/ca/certificate-authority_test.go index f2cfa07c6..26fa1286a 100644 --- a/ca/certificate-authority_test.go +++ b/ca/certificate-authority_test.go @@ -356,7 +356,7 @@ func TestRevoke(t *testing.T) { } cert, err := x509.ParseCertificate(certObj.DER) test.AssertNotError(t, err, "Certificate failed to parse") - serialString := fmt.Sprintf("%032x", cert.SerialNumber) + serialString := core.SerialToString(cert.SerialNumber) err = ca.RevokeCertificate(serialString) test.AssertNotError(t, err, "Revocation failed") @@ -415,7 +415,7 @@ func TestIssueCertificate(t *testing.T) { } // Verify that the cert got stored in the DB - serialString := fmt.Sprintf("%032x", cert.SerialNumber) + serialString := core.SerialToString(cert.SerialNumber) certBytes, err := storageAuthority.GetCertificate(serialString) test.AssertNotError(t, err, fmt.Sprintf("Certificate %s not found in database", serialString)) diff --git a/ra/registration-authority_test.go b/ra/registration-authority_test.go index 0c66bbb36..73da9304c 100644 --- a/ra/registration-authority_test.go +++ b/ra/registration-authority_test.go @@ -240,7 +240,7 @@ func TestNewCertificate(t *testing.T) { test.AssertNotError(t, err, "Failed to parse certificate") // Verify that cert shows up and is as expected - dbCert, err := sa.GetCertificate(fmt.Sprintf("%032x", parsedCert.SerialNumber)) + dbCert, err := sa.GetCertificate(core.SerialToString(parsedCert.SerialNumber)) test.AssertNotError(t, err, fmt.Sprintf("Could not fetch certificate %032x from database", parsedCert.SerialNumber)) test.Assert(t, bytes.Compare(cert.DER, dbCert) == 0, "Certificates differ") diff --git a/sa/storage-authority.go b/sa/storage-authority.go index f5dd5fece..25b0819e8 100644 --- a/sa/storage-authority.go +++ b/sa/storage-authority.go @@ -520,7 +520,7 @@ func (ssa *SQLStorageAuthority) AddCertificate(certDER []byte) (digest string, e if err != nil { return } - serial := fmt.Sprintf("%032x", parsedCertificate.SerialNumber) + serial := core.SerialToString(parsedCertificate.SerialNumber) tx, err := ssa.db.Begin() if err != nil {