Log certificate's serial number as stringified decimal number

Using a JSON string fixes a common issue with JSON parsers that
deserialize all numbers to a 64-bit IEEE-754 floats. (Certificate
serial numbers are usually 128 bit values.)

This change is consistent with existing log entries for revocation
requests.

See also: #630, #631
pull/641/head
Hilko Bengen 3 years ago
parent b9743b36e1
commit edb01bc9f2

@ -400,7 +400,7 @@ func logOtt(w http.ResponseWriter, token string) {
func LogCertificate(w http.ResponseWriter, cert *x509.Certificate) {
if rl, ok := w.(logging.ResponseLogger); ok {
m := map[string]interface{}{
"serial": cert.SerialNumber,
"serial": cert.SerialNumber.String(),
"subject": cert.Subject.CommonName,
"issuer": cert.Issuer.CommonName,
"valid-from": cert.NotBefore.Format(time.RFC3339),

Loading…
Cancel
Save