actually use them
This commit is contained in:
parent
771d6d9b6d
commit
ae62792d52
|
|
@ -356,7 +356,7 @@ func TestRevoke(t *testing.T) {
|
||||||
}
|
}
|
||||||
cert, err := x509.ParseCertificate(certObj.DER)
|
cert, err := x509.ParseCertificate(certObj.DER)
|
||||||
test.AssertNotError(t, err, "Certificate failed to parse")
|
test.AssertNotError(t, err, "Certificate failed to parse")
|
||||||
serialString := fmt.Sprintf("%032x", cert.SerialNumber)
|
serialString := core.SerialToString(cert.SerialNumber)
|
||||||
err = ca.RevokeCertificate(serialString)
|
err = ca.RevokeCertificate(serialString)
|
||||||
test.AssertNotError(t, err, "Revocation failed")
|
test.AssertNotError(t, err, "Revocation failed")
|
||||||
|
|
||||||
|
|
@ -415,7 +415,7 @@ func TestIssueCertificate(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that the cert got stored in the DB
|
// 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)
|
certBytes, err := storageAuthority.GetCertificate(serialString)
|
||||||
test.AssertNotError(t, err,
|
test.AssertNotError(t, err,
|
||||||
fmt.Sprintf("Certificate %s not found in database", serialString))
|
fmt.Sprintf("Certificate %s not found in database", serialString))
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ func TestNewCertificate(t *testing.T) {
|
||||||
test.AssertNotError(t, err, "Failed to parse certificate")
|
test.AssertNotError(t, err, "Failed to parse certificate")
|
||||||
|
|
||||||
// Verify that cert shows up and is as expected
|
// 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",
|
test.AssertNotError(t, err, fmt.Sprintf("Could not fetch certificate %032x from database",
|
||||||
parsedCert.SerialNumber))
|
parsedCert.SerialNumber))
|
||||||
test.Assert(t, bytes.Compare(cert.DER, dbCert) == 0, "Certificates differ")
|
test.Assert(t, bytes.Compare(cert.DER, dbCert) == 0, "Certificates differ")
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ func (ssa *SQLStorageAuthority) AddCertificate(certDER []byte) (digest string, e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
serial := fmt.Sprintf("%032x", parsedCertificate.SerialNumber)
|
serial := core.SerialToString(parsedCertificate.SerialNumber)
|
||||||
|
|
||||||
tx, err := ssa.db.Begin()
|
tx, err := ssa.db.Begin()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue