actually use them

This commit is contained in:
Roland Shoemaker 2015-05-06 16:47:27 -07:00
parent 771d6d9b6d
commit ae62792d52
3 changed files with 4 additions and 4 deletions

View File

@ -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))

View File

@ -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")

View File

@ -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 {