-
-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ra: revoke with explicit CRL shard #7944
Conversation
24ec095
to
ae2e387
Compare
@@ -4081,3 +4069,60 @@ func TestUpdateRegistrationKey(t *testing.T) { | |||
test.AssertContains(t, err.Error(), "failed to update registration key") | |||
test.AssertContains(t, err.Error(), "mocked to always error") | |||
} | |||
|
|||
func TestCRLShard(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: This does seem like a reasonable candidate for a table driven test with
type testCase struct {
cdp []string
wantShard int64
wantErr error
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good suggestion, but I'm going to take the easy path and merge as written.
In RA.RevokedCertificate, if the certificate being revoked has a crlDistributionPoints extension, parse the URL and pass the appropriate shard to the SA.
This required some changes to the
admin
tool. When a malformed certificate is revoked, we don't have a parsed copy of the certificate to extract a CRL URL from. So, specifically when a malformed certificate is being revoked, allow specifying a CRL shard. Because different certificates will have different shards, require one-at-a-time revocation for malformed certificates.To support that refactoring, move the serial-cleaning functionality earlier in the
admin
tool's flow.Also, split out one of the cases handled by the
revokeCertificate
helper in the RA. For admin revocations, we need to accept a human-specified ShardIdx, so call the SA directly in that case (and skip stat increment since admin revocations aren't useful for metrics). This allowsrevokeCertificate
to be a more helpful helper, by extracting serial, issuer ID, and CRL shard automatically from an*x509.Certificate
.Note: we don't yet issue certificates with the crlDistributionPoints extension, so this code will not be active until we start doing so.
Part of #7094.