Skip to content

ACME Certificate Revocation #625

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

Merged
merged 27 commits into from
Dec 9, 2021
Merged

Conversation

hslatman
Copy link
Member

@hslatman hslatman commented Jul 3, 2021

This PR adds ACME certificate revocation as discussed in #468.

Basic revocation using either JWK or KID works. Needs error handling improvements and tests.

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Jul 17, 2021
@dopey dopey removed the needs triage Waiting for discussion / prioritization by team label Nov 18, 2021
@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Nov 24, 2021
@hslatman hslatman changed the title ACME Certificate Revocation (WIP) ACME Certificate Revocation Nov 28, 2021
The logic for both test cases is fairly similar, but with some
small differences. Made those clearer by means of some comments.
Also added some comments to the middleware logic that decided
whether to extract JWK or lookup by KID.
@hslatman hslatman requested a review from dopey December 2, 2021 15:34
@dopey dopey removed the needs triage Waiting for discussion / prioritization by team label Dec 2, 2021
extractPayloadByJWK := func(next nextHTTP) nextHTTP {
return h.baseURLFromRequest(h.lookupProvisioner(h.addNonce(h.addDirLink(h.verifyContentType(h.parseJWS(h.validateJWS(h.extractJWK(h.verifyAndExtractJWSPayload(next)))))))))
return validatingMiddleware(h.validateJWS(h.extractJWK(h.verifyAndExtractJWSPayload(next))))
Copy link
Contributor

Choose a reason for hiding this comment

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

should ValidateJWS also be part of validateMiddleware?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point 😅. I have to admit validatingMiddleware is not that great of a name, as it does more than just that, but it works.

Fixed in 004fc05.

}

// extractIdentifiers extracts ACME identifiers from an x509 certificate and
// creates a map from them. The map ensures that double SANs are deduplicated.
Copy link
Contributor

Choose a reason for hiding this comment

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

double -> duplicated

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 004fc05

}
result[identifierKey(identifier)] = identifier
}
// TODO(hs): should we include the CommonName or not?
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we can remove this comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 004fc05

As discussed in smallstep#767,
we opted for not including this authorization flow to prevent users
from getting OOMs. We can add the functionality back when the
underlying data store can provide access to a long list of
Authorizations more efficiently, for example when a callback is
implemented.
@hslatman hslatman requested a review from dopey December 8, 2021 15:52
Copy link
Contributor

@dopey dopey left a comment

Choose a reason for hiding this comment

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

lgtm

@hslatman hslatman removed the needs triage Waiting for discussion / prioritization by team label Dec 9, 2021
@hslatman hslatman merged commit fbd3fd2 into smallstep:master Dec 9, 2021
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.

2 participants