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.
diff --git a/include/mbedtls/x509.h b/include/mbedtls/x509.h
index 2a9ce99..e37573f 100644
--- a/include/mbedtls/x509.h
+++ b/include/mbedtls/x509.h
@@ -313,8 +313,8 @@
* Internal module functions. You probably do not want to use these unless you
* know you do.
*/
-int mbedtls_x509_get_name( unsigned char **p, const unsigned char *end,
- mbedtls_x509_name *cur );
+int mbedtls_x509_get_name( unsigned char *p, size_t len,
+ mbedtls_x509_name *cur );
int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end,
mbedtls_x509_buf *alg );
int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end,
diff --git a/include/mbedtls/x509_crl.h b/include/mbedtls/x509_crl.h
index b035c6c..2950f30 100644
--- a/include/mbedtls/x509_crl.h
+++ b/include/mbedtls/x509_crl.h
@@ -76,7 +76,6 @@
mbedtls_x509_buf sig_oid; /**< CRL signature type identifier */
mbedtls_x509_buf_raw issuer_raw; /**< The raw issuer data (DER). */
- mbedtls_x509_buf_raw issuer_raw_no_hdr;
mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */
diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h
index 4335ab3..e4b8882 100644
--- a/include/mbedtls/x509_crt.h
+++ b/include/mbedtls/x509_crt.h
@@ -95,9 +95,6 @@
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 @@
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). */