Solely use raw X.509 name data references including SEQUENCE header

So far, the CRT frame structure `mbedtls_x509_crt_frame` used
as `issuer_raw` and `subject_raw` the _content_ of the ASN.1
name structure for issuer resp. subject. This was in contrast
to the fields `issuer_raw` and `subject_raw` from the legacy
`mbedtls_x509_crt` structure, and caused some information
duplication by having both variants `xxx_no_hdr` and `xxx_with_hdr`
in `mbedtls_x509_crt` and `mbedtls_x509_crt_frame`.

This commit removes this mismatch by solely using the legacy
form of `issuer_raw` and `subject_raw`, i.e. those _including_
the ASN.1 name header.
This commit is contained in:
Hanno Becker 2019-03-04 14:43:43 +00:00
parent 4e021c8f50
commit 1e11f217d4
9 changed files with 74 additions and 83 deletions

View file

@ -95,9 +95,6 @@ typedef struct mbedtls_x509_crt_frame
mbedtls_x509_buf_raw subject_alt_raw; /**< The raw data for the SubjectAlternativeNames extension. */
mbedtls_x509_buf_raw ext_key_usage_raw; /**< The raw data for the ExtendedKeyUsage extension. */
mbedtls_x509_buf_raw issuer_raw_with_hdr;
mbedtls_x509_buf_raw subject_raw_with_hdr;
} mbedtls_x509_crt_frame;
/* This is an internal structure used for caching parsed data from an X.509 CRT.
@ -139,9 +136,6 @@ typedef struct mbedtls_x509_crt
mbedtls_x509_buf issuer_raw; /**< The raw issuer data (DER). Used for quick comparison. */
mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). Used for quick comparison. */
mbedtls_x509_buf_raw subject_raw_no_hdr;
mbedtls_x509_buf_raw issuer_raw_no_hdr;
mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */
mbedtls_x509_name subject; /**< The parsed subject data (named information object). */