Skip to content

Use GetRevocationStatus instead of GetCertificateStatus - #8402

Merged
aarongable merged 3 commits into
mainfrom
revocation-status
Sep 25, 2025
Merged

aarongable merged 3 commits into
mainfrom
revocation-status

Conversation

@aarongable

@aarongable aarongable commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

In the SA, change the implementation of GetRevocationStatus to read from the revokedCertificates table instead of reading from the certificateStatus table.

In the WFE, switch to calling GetRevocationStatus when computing ARI windows. Similarly, in the RA, make the same switch when checking if a to-be-revoked certificate is already revoked.

Across all three locations, use new core constants to represent "good" and "revoked", to avoid references to OCSP and unwieldy string/int conversions.

This paves the way for removing sa.GetCertificateStatus, which now has only one remaining caller which is not quite so easily changed.

Part of #8322


Warning

Do not merge before #8400

Base automatically changed from all-explicit-sharding to main September 23, 2025 16:38
@aarongable
aarongable marked this pull request as ready for review September 23, 2025 16:56
@aarongable
aarongable requested a review from a team as a code owner September 23, 2025 16:56
@aarongable
aarongable requested a review from jprenken September 23, 2025 16:56
jprenken
jprenken previously approved these changes Sep 24, 2025
@jprenken
jprenken requested review from a team and beautifulentropy and removed request for a team September 24, 2025 04:52

@beautifulentropy beautifulentropy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We're preserving the behavior where SQLStorageAuthorityRO.GetRevocationStatus() returns NotFound for serials that do not match a known certificate, which is great. We should update the method doc comment to indicate that this is part of its API contract.

Similarly, we're depending on SQLStorageAuthorityRO.GetSerialMetadata() to return NotFound so that we meet this contract, we should update the doc comment for that as well.

Otherwise, the change looks great and makes perfect sense. I'm a little sad to see us take an extra query hit, but it keeps this method safe.

Comment thread sa/saro.go Resolved
jprenken
jprenken previously approved these changes Sep 24, 2025
Comment thread sa/saro.go Resolved
Comment thread sa/saro.go Resolved
aarongable added a commit that referenced this pull request Oct 2, 2025
This reverts #8402

The revokedCertificates table does not have an index on the `serial`
column, unlike the certificateStatus table. This means that these
highly-targeted, single-certificate lookups are actually very
inefficient, and led to performance problems in the database.

This revert will be followed by a schema change to add an index to the
revokedCertificates table, and then by a reland of the original PR.

Part of #8322
aarongable added a commit that referenced this pull request Oct 2, 2025
In the SA, change the implementation of GetRevocationStatus to read from
the revokedCertificates table instead of reading from the
certificateStatus table.

In the WFE, switch to calling GetRevocationStatus when computing ARI
windows. Similarly, in the RA, make the same switch when checking if a
to-be-revoked certificate is already revoked.

Across all three locations, use new core constants to represent "good"
and "revoked", to avoid references to OCSP and unwieldy string/int
conversions.

This paves the way for removing sa.GetCertificateStatus, which now has
only one remaining caller which is not quite so easily changed.

Part of #8322

(cherry picked from commit a5cf372)
aarongable added a commit that referenced this pull request Oct 2, 2025
In the SA, change the implementation of GetRevocationStatus to read from
the revokedCertificates table instead of reading from the
certificateStatus table.

In the WFE, switch to calling GetRevocationStatus when computing ARI
windows. Similarly, in the RA, make the same switch when checking if a
to-be-revoked certificate is already revoked.

Across all three locations, use new core constants to represent "good"
and "revoked", to avoid references to OCSP and unwieldy string/int
conversions.

This paves the way for removing sa.GetCertificateStatus, which now has
only one remaining caller which is not quite so easily changed.

Part of #8322

(cherry picked from commit a5cf372)
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.

4 participants