-
Notifications
You must be signed in to change notification settings - Fork 3k
public_key: Add support for ExtensionRequest #10031
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
public_key: Add support for ExtensionRequest #10031
Conversation
CT Test Results 2 files 17 suites 4m 43s ⏱️ Results for commit 5f88033. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
c29bdd7 to
94ebbb9
Compare
94ebbb9 to
086bf9d
Compare
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.
Pull Request Overview
This PR introduces support for the legacy PKCS-9 ExtensionRequest by adding modern ASN.1 modules and wiring up encode/decode fallbacks.
- Add new ASN.1 specs: EnrollmentMessageSyntax-2009 and PKIXCRMF-2009
- Update
public_key.erlto handle'ExtensionReq'/'ExtensionRequest'inder_encode/der_decode - Extend tests, application config, include files, and Makefiles to build and verify the new support
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/public_key/test/public_key_SUITE.erl | Added pkix_extensionreq tests for DER-encode of ExtensionReq |
| lib/public_key/src/public_key.erl | Implemented der_encode/der_decode fallbacks for ExtensionRequest |
| lib/public_key/src/public_key.app.src | Included new ASN.1 modules in application definition |
| lib/public_key/include/public_key.hrl | Updated PKCS-9 comment for pkcs-9-at-extensionRequest OID |
| lib/public_key/asn1/Makefile | Added EnrollmentMessageSyntax-2009 and PKIXCRMF-2009 to build list |
| lib/public_key/asn1/EnrollmentMessageSyntax-2009.asn1 | New ASN.1 specification for ExtensionReq |
| lib/public_key/asn1/PKIXCRMF-2009.asn1 | New ASN.1 specification to support CRMF components |
Comments suppressed due to low confidence (2)
lib/public_key/test/public_key_SUITE.erl:1580
- The test currently only verifies DER-encode behavior. Add a complementary assertion invoking
public_key:der_decode('ExtensionRequest', Expected)and matching its result to the expected term to ensure decode support is covered.
Expected = <<48,0>>,
lib/public_key/src/public_key.erl:581
- [nitpick] Add a brief function-level comment above this clause to document that
'ExtensionRequest'is mapped to'ExtensionReq'for backwards compatibility, aiding future maintainers.
der_decode('ExtensionRequest', Value) ->
cbb64ab to
63bf05b
Compare
08f69df to
965949e
Compare
965949e to
9f1fbe4
Compare
lib/public_key/src/public_key.erl
Outdated
| error:{badmatch, {error, _}} = Error -> | ||
| erlang:error(Error) | ||
| end; | ||
| %% Bakwards compatibility |
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.
global typo, which you fixed above not here. run grep please.
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.
@u3s I did, maybe it was that it was the first word here so that it started with B and not b ! Fixed anyhow please re-approve.
Add modern ASN-1 specs to be able to retain support for ExtensionRequest from legacy PKCS-9 spec. This can open up for further support of EnrollmentMessageSyntax-2009 being added later. Also add some missing backwards compatibility for X520CommonName and legacy AttributeTypeAndValue Closes erlang#10028
9f1fbe4 to
5f88033
Compare
Add modern ASN-1 specs to be able to retain support for ExtensionRequest from legacy PKCS-9 spec.
This can open up for further support being added later.
Closes #10028