Skip to content

Include the SPKI algorithm in log entries - #186

Merged
davidben merged 3 commits into
mainfrom
log-pkey-alg
Feb 27, 2026
Merged

Include the SPKI algorithm in log entries#186
davidben merged 3 commits into
mainfrom
log-pkey-alg

Conversation

@davidben

Copy link
Copy Markdown
Collaborator

While this makes log entries bigger, the modern tlog-based API compresses runs of 256 entries together, so they should gzip fairly well.

Including the algorithm can allow folks to more easily monitor the status of an algorithm transition, and flag some misconfigurations. For example, a PQ-incapable server might ask both a classical and PQ CA to sign its classical key. But a PQ-capable server should ask a classical CA to sign the classical key and a PQ CA to sign its PQ key.

Closes #76

While this makes log entries bigger, the modern tlog-based API
compresses runs of 256 entries together, so they should gzip fairly
well.

Including the algorithm can allow folks to more easily monitor the
status of an algorithm transition, and flag some misconfigurations. For
example, a PQ-incapable server might ask both a classical and PQ CA to
sign its classical key. But a PQ-capable server should ask a classical
CA to sign the classical key and a PQ CA to sign its PQ key.

Closes #76
@davidben
davidben requested a review from bwesterb February 24, 2026 20:28

@bwesterb bwesterb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we mention algorithm in this line?

When hashing subjectPublicKeyInfo, either hash the observed BER encoding, or reparse the structure with a conforming DER parser and fail verification if invalid.

The TBSCertificate's `serialNumber` MUST contain the zero-based index of the TBSCertificateLogEntry in the log. {{Section 4.1.2.2 of !RFC5280}} forbids zero as a serial number, but {{log-entries}} defines a `null_entry` type for use in entry zero, so the index will be positive. This encoding is intended to avoid implementation errors by having the serial numbers and indices off by one.

The TBSCertificate's `subjectPublicKeyInfo` contains the specified public key. Its hash MUST match the TBSCertificateLogEntry's `subjectPublicKeyInfoHash`.
The TBSCertificate's `subjectPublicKeyInfo` contains the specified public key. Its `algorithm` field MUST match the TBSCertificateLogEntry's `subjectPublicKeyAlgorithm`. Its hash MUST match the TBSCertificateLogEntry's `subjectPublicKeyInfoHash`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

subjectPublicKeyAlgorithm ≠ subjectPublicKeyInfoAlgorithm

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Whoops. Made the rest of them match subjectPublicKeyAlgorithm. Not sure if the "info" is doing anything here and subjectPublicKeyAlgorithm is shorter.

@davidben

Copy link
Copy Markdown
Collaborator Author

Should we mention algorithm in this line?

When hashing subjectPublicKeyInfo, either hash the observed BER encoding, or reparse the structure with a conforming DER parser and fail verification if invalid.

I think it's okay without? This bit is talking about non-malleability. It is both necessary and sufficient to capture the SPKI encoding in the hash. At that point, you've already locked in the SPKI encoding and having the algorithm elsewhere doesn't matter.

@davidben
davidben merged commit 44f7abc into main Feb 27, 2026
2 checks passed
@davidben
davidben deleted the log-pkey-alg branch February 27, 2026 19:41
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.

subjectPublicKeyInfoHash hides the public key algorithm

3 participants