Skip to content

Commit

Permalink
Merge 0bd39da into 62e6a5e
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed Apr 28, 2015
2 parents 62e6a5e + 0bd39da commit 53fd5e2
Show file tree
Hide file tree
Showing 9 changed files with 262 additions and 203 deletions.
4 changes: 2 additions & 2 deletions ca/certificate-authority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ func TestIssueCertificate(t *testing.T) {
}

// Verify that the cert got stored in the DB
shortSerial := fmt.Sprintf("%016x", cert.SerialNumber)[0:16]
shortSerial := fmt.Sprintf("%032x", cert.SerialNumber)[0:16]
_, err = sa.GetCertificate(shortSerial)
test.AssertNotError(t, err,
fmt.Sprintf("Certificate %016x not found in database", shortSerial))
fmt.Sprintf("Certificate %032x not found in database", cert.SerialNumber))
}

// Test that the CA rejects CSRs with no names
Expand Down
6 changes: 6 additions & 0 deletions log/audit-logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ func (log *AuditLogger) Warning(msg string) (err error) {
log.Stats.Inc("Logging.Warning", 1, 1.0)
return log.Writer.Warning(msg)
}

func (log *AuditLogger) Notice(msg string) (err error) {
fmt.Println(msg)
log.Stats.Inc("Logging.Notice", 1, 1.0)
return log.Writer.Notice(msg)
}
5 changes: 3 additions & 2 deletions ra/registration-authority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,12 @@ func TestNewCertificate(t *testing.T) {
test.AssertNotError(t, err, "Failed to issue certificate")
parsedCert, err := x509.ParseCertificate(cert.DER)
test.AssertNotError(t, err, "Failed to parse certificate")
shortSerial := fmt.Sprintf("%016x", parsedCert.SerialNumber)[0:16]
shortSerial := fmt.Sprintf("%032x", parsedCert.SerialNumber)[0:16]

// Verify that cert shows up and is as expected
dbCert, err := sa.GetCertificate(shortSerial)
test.AssertNotError(t, err, "Could not fetch certificate from database")
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")

// TODO Test failure cases
Expand Down
2 changes: 1 addition & 1 deletion sa/storage-authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (ssa *SQLStorageAuthority) AddCertificate(certDER []byte) (digest string, e
if err != nil {
return
}
serial := fmt.Sprintf("%016x", parsedCertificate.SerialNumber)
serial := fmt.Sprintf("%032x", parsedCertificate.SerialNumber)

tx, err := ssa.db.Begin()
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ doTest wfe
[ -e $GOBIN/gover ] && run $GOBIN/gover

if [ "${TRAVIS}" == "true" ] ; then
run $GOBIN/goveralls -coverprofile=gover.coverprofile -service=travis-ci
# We don't use the run function here because sometimes goveralls fails to
# contact the server and exits with non-zero status, but we don't want to
# treat that as a failure.
$GOBIN/goveralls -coverprofile=gover.coverprofile -service=travis-ci
fi

exit ${FAILURE}
3 changes: 2 additions & 1 deletion test/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"cli": "^0.6.5",
"inquirer": "^0.8.2",
"node-forge": "^0.6.21"
"node-forge": "^0.6.21",
"request": "^2.55.0"
}
}
Loading

0 comments on commit 53fd5e2

Please sign in to comment.