Add buffer with raw issuer data to CRL structure
To make use of the X.509 name comparison function based on raw
ASN.1 data that was introduced in the previous commit, this commit
adds an ASN.1 buffer field `issuer_raw_no_hdr` to `mbedtls_x509_crl`
which delimits the raw contents of the CRLs `Issuer` field.
The previous field `issuer_raw` isn't suitable for that because
it includes the ASN.1 header.
diff --git a/library/x509_crl.c b/library/x509_crl.c
index a56d5e3..f077841 100644
--- a/library/x509_crl.c
+++ b/library/x509_crl.c
@@ -428,6 +428,7 @@
mbedtls_x509_crl_free( crl );
return( MBEDTLS_ERR_X509_INVALID_FORMAT + ret );
}
+ crl->issuer_raw_no_hdr.p = p;
if( ( ret = mbedtls_x509_get_name( &p, p + len, &crl->issuer ) ) != 0 )
{
@@ -435,6 +436,7 @@
return( ret );
}
+ crl->issuer_raw_no_hdr.len = p - crl->issuer_raw_no_hdr.p;
crl->issuer_raw.len = p - crl->issuer_raw.p;
/*