Skip to content
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

Remove non-working check from x509_get_subject_alt_name #2855

Merged
merged 3 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.d/bugfix_PR2855.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Bugfix
* Remove dead code in X.509 certificate parsing. Contributed by irwir in #2855.
6 changes: 1 addition & 5 deletions library/x509_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,6 @@ static int x509_get_subject_alt_name( unsigned char **p,
mbedtls_x509_subject_alternative_name dummy_san_buf;
memset( &dummy_san_buf, 0, sizeof( dummy_san_buf ) );

if( ( end - *p ) < 1 )
return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS +
MBEDTLS_ERR_ASN1_OUT_OF_DATA );

tag = **p;
(*p)++;
if( ( ret = mbedtls_asn1_get_len( p, end, &tag_len ) ) != 0 )
Expand All @@ -669,7 +665,7 @@ static int x509_get_subject_alt_name( unsigned char **p,
}

/*
* Check that the SAN are structured correct.
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is outside of the PRs scope. I'd suggest not mixing in extra changes with the main ones. But this is far from being a blocker.

* Check that the SAN is structured correctly.
*/
ret = mbedtls_x509_parse_subject_alt_name( &(cur->buf), &dummy_san_buf );
/*
Expand Down