-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added parsing of v3 extension subject key identifier #2018
Added parsing of v3 extension subject key identifier #2018
Conversation
library/x509_crt.c
Outdated
MBEDTLS_ASN1_OCTET_STRING ) ) == 0 ) | ||
{ | ||
crt->subject_key_id.len = len; | ||
crt->subject_key_id.tag = MBEDTLS_ASN1_OCTET_STRING; |
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.
Minor: Double white space
library/x509_crt.c
Outdated
@@ -800,6 +800,21 @@ static int x509_get_crt_ext( unsigned char **p, | |||
return( ret ); | |||
break; | |||
|
|||
case MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER: | |||
if( ( ret = mbedtls_asn1_get_tag( p, end_ext_data, &len, | |||
MBEDTLS_ASN1_OCTET_STRING ) ) == 0 ) |
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.
Minor: Please swap the branches here: return immediately if ret != 0
, and otherwise proceed with the setup of crt->subject_key_id
.
library/x509_crt.c
Outdated
crt->subject_key_id.len = len; | ||
crt->subject_key_id.tag = MBEDTLS_ASN1_OCTET_STRING; | ||
crt->subject_key_id.p = *p; | ||
*p +=len; |
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.
Minor: Space missing
library/oid.c
Outdated
@@ -278,6 +278,10 @@ static const oid_x509_ext_t oid_x509_ext[] = | |||
{ ADD_LEN( MBEDTLS_OID_NS_CERT_TYPE ), "id-netscape-certtype", "Netscape Certificate Type" }, | |||
MBEDTLS_X509_EXT_NS_CERT_TYPE, | |||
}, | |||
{ | |||
{ ADD_LEN( MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER ), "id-ce-subjectKeyIdentifier", "Subject Key Identifier" }, //Peter added |
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.
Minor: Please remove the comment.
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.
Thank you for your contribution! I haven't studied the details of the extension yet, but noted a few style issues that could be fixed immediately. Also, could you please add an entry to the ChangeLog
?
@PeterFredrikssonAF thank you for your contribution! I apologize for delay, however I just noticed you haven't accepted out CLA. If this is a personal contribution, the easiest way to do this is if you create an mbed account and accept this click through agreement. Alternatively, you can find a slightly different agreement to sign here, which can be signed and returned to us, and is applicable if you don't want to create an mbed account or alternatively if this is a corporate contribution. Thanks for your understanding and again, thanks for the contribution! |
@hanno-arm we ran into the same issue today (looking for a way to get the subject key identifier). Unlike the original PR, we would also need the authority key identifier, which also appears to be missing. For the time being I'll patch my branch to add such functionalities. If I have the time after I'll create a clean PR. |
Hi @PeterFredrikssonAF and @awakecoding I'm sorry this PR stalled a while ago. It looks like this was partly due to the lack of a CLA. The good news is our contributing guidelines have a changed and a CLA is no longer required. We just need a "Signed-off-by:" to indicate acceptance of the DCO. The PR still seems relevant. Let us know if you have time to submit a reworked/rebased PR. Regards Dan. |
This will probably be subsumed by #1425 (depending on how that design ends up). |
Hi All, i am facing issue with the above given implementation. |
No description provided.