Skip to content

Ceremony: generate serials with a prefix to guarantee length#8899

Open
aarongable wants to merge 1 commit into
mainfrom
ca-serial-prefix
Open

Ceremony: generate serials with a prefix to guarantee length#8899
aarongable wants to merge 1 commit into
mainfrom
ca-serial-prefix

Conversation

@aarongable

@aarongable aarongable commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This borrows code very similar to that used in ca.go:generateSerialNumber to ensure that our CA serials always obviously contain the desired number of bytes, even if the random number generator gives us lots of leading zeroes that a DER encoding would elide.

@aarongable
aarongable marked this pull request as ready for review July 24, 2026 00:01
@aarongable
aarongable requested a review from a team as a code owner July 24, 2026 00:01
@aarongable
aarongable requested a review from ezekiel July 24, 2026 00:01

@jsha jsha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with the caveat that we're blocked on CP/CPS update.

Comment thread cmd/ceremony/cert.go
// We want 128 bits of random number, plus a prefix to ensure that the serial is
// never shorter than that, even if the CSPRNG generates lots of leading zeroes.
const randBits = 128
serial := make([]byte, randBits/8+1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the CP/CPS to say the new number of bits (or encoded bytes) for our issuing certificate profiles before we land this. Resolve this conversation once we've done that, then we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants