-
Notifications
You must be signed in to change notification settings - Fork 1k
Add support for id-on-bundleEID from RFC 9174. #10810
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
Open
kareem-wolfssl
wants to merge
3
commits into
wolfSSL:master
Choose a base branch
from
kareem-wolfssl:gh10694
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Binary file not shown.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,8 @@ ASN Options: | |
| * WOLFSSL_ALLOW_AKID_SKID_MATCH: By default cert issuer is found using hash | ||
| * of cert subject hash with signers subject hash. This option allows fallback | ||
| * to using AKID and SKID matching. | ||
| * WOLFSSL_DTN: Enables Delay-Tolerant Networking (RFC 9174) support. | ||
| * Currently this enables id-on-bundleEID in otherName. | ||
| * | ||
| * Certificate Generation/Parsing: | ||
| * WOLFSSL_CERT_REQ: Enable certificate request (CSR) support | ||
|
|
@@ -18939,12 +18941,20 @@ static int ConfirmNameConstraints(Signer* signer, DecodedCert* cert) | |
| * (RFC3280 sec 4.2.1.7). Often used with FIPS 201 smartcard login. | ||
| * FASC-N (Federal Agency Smart Credential Number), defined in the document | ||
| * fpki-x509-cert-policy-common.pdf. Used for a smart card ID. | ||
| * | ||
| * id-on-bundleEID (RFC 9174, sec 4.4.1), an Other Name whose value is an | ||
| * IA5String holding a Bundle Protocol node/endpoint ID (e.g. "dtn://node/"). | ||
| * Only handled when WOLFSSL_DTN is defined as these OIDs are specific to | ||
| * Delay-Tolerant Networking (DTN) / the Bundle Protocol. | ||
| */ | ||
| static const ASNItem otherNameASN[] = { | ||
| /* TYPEID */ { 0, ASN_OBJECT_ID, 0, 0, 0 }, | ||
| /* VALUE */ { 0, ASN_CONTEXT_SPECIFIC | ASN_OTHERNAME_VALUE, 1, 1, 0 }, | ||
| /* UPN */ { 1, ASN_UTF8STRING, 0, 0, 2 }, | ||
| /* FASC-N */ { 1, ASN_OCTET_STRING, 0, 0, 2 }, | ||
| #ifdef WOLFSSL_DTN | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add WOLFSSL_DTN to the settings.h
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document this new macro at top of asn.c. Thanks |
||
| /* BEID */ { 1, ASN_IA5_STRING, 0, 0, 2 }, | ||
| #endif | ||
| /* HWN_SEQ */ { 1, ASN_SEQUENCE, 1, 0, 2 }, | ||
| /* HWN_TYPE */ { 2, ASN_OBJECT_ID, 0, 0, 0 }, | ||
| /* HWN_NUM */ { 2, ASN_OCTET_STRING, 0, 0, 0 } | ||
|
|
@@ -18954,6 +18964,9 @@ enum { | |
| OTHERNAMEASN_IDX_VALUE, | ||
| OTHERNAMEASN_IDX_UPN, | ||
| OTHERNAMEASN_IDX_FASCN, | ||
| #ifdef WOLFSSL_DTN | ||
| OTHERNAMEASN_IDX_BEID, | ||
| #endif | ||
| OTHERNAMEASN_IDX_HWN_SEQ, | ||
| OTHERNAMEASN_IDX_HWN_TYPE, | ||
| OTHERNAMEASN_IDX_HWN_NUM | ||
|
|
@@ -19021,6 +19034,13 @@ static int DecodeOtherHelper(ASNGetData* dataASN, DecodedCert* cert, int oid) | |
| bufLen = dataASN[OTHERNAMEASN_IDX_UPN].data.ref.length; | ||
| buf = (const char*)dataASN[OTHERNAMEASN_IDX_UPN].data.ref.data; | ||
| break; | ||
| #ifdef WOLFSSL_DTN | ||
| case BUNDLE_EID_OID: | ||
| /* id-on-bundleEID (RFC 9174) carries an IA5String value. */ | ||
| bufLen = dataASN[OTHERNAMEASN_IDX_BEID].data.ref.length; | ||
| buf = (const char*)dataASN[OTHERNAMEASN_IDX_BEID].data.ref.data; | ||
| break; | ||
| #endif /* WOLFSSL_DTN */ | ||
| default: | ||
| WOLFSSL_ERROR_VERBOSE(ASN_UNKNOWN_OID_E); | ||
| ret = ASN_UNKNOWN_OID_E; | ||
|
|
@@ -19084,6 +19104,9 @@ static int DecodeOtherName(DecodedCert* cert, const byte* input, | |
| #ifdef WOLFSSL_FPKI | ||
| case FASCN_OID: | ||
| #endif /* WOLFSSL_FPKI */ | ||
| #ifdef WOLFSSL_DTN | ||
| case BUNDLE_EID_OID: | ||
| #endif /* WOLFSSL_DTN */ | ||
| case UPN_OID: | ||
| ret = DecodeOtherHelper(dataASN, cert, | ||
| (int)dataASN[OTHERNAMEASN_IDX_TYPEID].data.oid.sum); | ||
|
|
@@ -19289,7 +19312,7 @@ static int DecodeGeneralName(const byte* input, word32* inOutIdx, byte tag, | |
| if (ret != 0) { | ||
| return ret; | ||
| } | ||
| #if defined(WOLFSSL_SEP) || defined(WOLFSSL_FPKI) | ||
| #if defined(WOLFSSL_SEP) || defined(WOLFSSL_FPKI) || defined(WOLFSSL_DTN) | ||
| /* FPKI/SEP also OID-decode the otherName into a separate altNames | ||
| * entry that holds the parsed UPN/FASCN value (with oidSum != 0). | ||
| * That parsed entry is consumed by wc_GetUUIDFromCert / | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.