Repository navigation
fix(ocsp): answer OCSP for old-key leaves with the previous responder after a re-key - #393
Merged
Merged
Conversation
… after a re-key A re-key discards the old CA key, so leaves it issued could no longer get an OCSP response that verifies against the certificate they chain to. The commit now moves the responder, its key and the old CA certificate to a separate slot in the same transaction, requests naming the old key are answered from it, and the slot is dropped once the responder expires. Responses also echo the request's CertID hash algorithm (RFC 6960 section 4.2.1); they always used SHA-1 before, which a SHA-256 request can't match. Closes #387 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Bugs5382
marked this pull request as ready for review
November 2, 2026 04:56
Bugs5382
marked this pull request as draft
November 2, 2026 12:15
Bugs5382
marked this pull request as ready for review
November 2, 2026 12:15
Contributor
Author
|
Closing summary: after an Intermediate re-key, the node keeps the previous OCSP responder until it expires, at most 7 days, and answers requests for leaves of the old key with it, so those leaves keep validating. Responses now use the request's hash algorithm instead of always SHA-1, which fixes SHA-256 clients on every node. It ships in v0.1.0-rc.2 instead of waiting for v0.1.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
After an Intermediate re-key the node throws away the old CA key, and since #386 it re-mints the responder under the new key. A client checking a leaf issued before the re-key validates against the old Intermediate, the one that leaf chains to, so it rejected the response on the signature. This keeps those leaves working until the old responder expires.
CommitRotationmoves the stored responder, its key and the old CA certificate to a previous-responder slot in the same transaction as the swap./ocspchecks the slot first. A request whose CertID names the old CA (name hash and key hash, RFC 6960 section 4.1.1) is answered with the kept responder. This path never loads the CA key. Any other request takes the current path unchanged.Two calls I made beyond the issue text:
Not in this change: the CRL for old leaves is signed by the new key too, as the issue says.
Closes #387.
No docs change: no docs page describes OCSP behaviour after a re-key.
Merge order: I moved this to main so it ships in v0.1.0-rc.2 and gets full CI now. It doesn't depend on any other open PR.
Verification
How this was verified
GitHub Actions doesn't run on this PR: every workflow is scoped to
branches: [main]. All of this ran locally, under go1.26.8, and nothing has run in CI.internal/init/ocsp_previous_test.godrives the real rekeyer and enroller.ocsp.ParseResponseForCertagainst the old Intermediate failed before the fix withbad OCSP signatureand passes now.TestRequestNamesIssuercovers SHA-1, 256, 384 and 512 with same name other key, and other name same key.go vet,CGO_ENABLED=0 go build ./...,go test -count=1 ./...(all packages),go mod tidyclean, golic, gitleaks, and DCO sign-off.ci-kind-acme, the appliance image suite, and any TPM-backed or lab re-key. The responder key is a software key in both the slot and the current path, but this hasn't been through a real re-key on an image.Before merging: add a closing comment summarizing what was actually done in this PR
(not just the checked boxes).