Skip to content

Commit

Permalink
fix: HEX number len = 40
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-lobocki committed Aug 2, 2024
1 parent 597b85b commit dc53a95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/output_x509certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ func emitOpenSsl(thisX509CertsWithRevocations []tX509CertificateProvisionerRevoc
revokedAt = ""
}

fmt.Printf("%s\t%s\t%s\t%039X\t%s\t%s\n",
fmt.Printf("%s\t%s\t%s\t%040X\t%s\t%s\n",
x509CertWithRevocation.Validity[0:1],
regexp.MustCompile(`[-T:]+`).
ReplaceAllString(x509CertWithRevocation.X509Certificate.NotAfter.UTC().
Format(time.RFC3339), "")[2:], // Construct NotAfter string in compliance with specification.
revokedAt,
x509CertWithRevocation.X509Certificate.SerialNumber, // len(HEX)=39
x509CertWithRevocation.X509Certificate.SerialNumber, // len(HEX(20bytes))=40chars [FF/byte]
"unknown", // As per specification.
x509CertWithRevocation.X509Certificate.Subject)
}
Expand Down

0 comments on commit dc53a95

Please sign in to comment.