Extracting SubjectKeyId and AuthorityKeyId in case of x509 V3 extensions. Updating mbedtls_x509_crt_free function to also free the new dynamic elements (issuer field of AuthorityKeyId).
A few tests are also added which test the feature with a correct certificate and multiple ones with erroneous ASN1 tags. Signed-off-by: toth92g <toth92g@gmail.com>
This commit is contained in:
parent
56f59d749c
commit
a41954d0cf
14 changed files with 437 additions and 2 deletions
|
@ -243,6 +243,17 @@ typedef mbedtls_asn1_named_data mbedtls_x509_name;
|
|||
*/
|
||||
typedef mbedtls_asn1_sequence mbedtls_x509_sequence;
|
||||
|
||||
/*
|
||||
* Container for the fields of the Authority Key Identifier object
|
||||
*/
|
||||
typedef struct mbedtls_x509_authority {
|
||||
mbedtls_x509_buf keyIdentifier;
|
||||
mbedtls_x509_name authorityCertIssuer;
|
||||
mbedtls_x509_buf authorityCertSerialNumber;
|
||||
mbedtls_x509_buf raw;
|
||||
}
|
||||
mbedtls_x509_authority;
|
||||
|
||||
/** Container for date and time (precision in seconds). */
|
||||
typedef struct mbedtls_x509_time {
|
||||
int year, mon, day; /**< Date. */
|
||||
|
|
|
@ -76,6 +76,8 @@ typedef struct mbedtls_x509_crt {
|
|||
mbedtls_x509_buf subject_id; /**< Optional X.509 v2/v3 subject unique identifier. */
|
||||
mbedtls_x509_buf v3_ext; /**< Optional X.509 v3 extensions. */
|
||||
mbedtls_x509_sequence subject_alt_names; /**< Optional list of raw entries of Subject Alternative Names extension (currently only dNSName, uniformResourceIdentifier, DirectoryName and OtherName are listed). */
|
||||
mbedtls_x509_buf subject_key_id; /**< Optional X.509 v3 extension subject key identifier. */
|
||||
mbedtls_x509_authority authority_key_id; /**< Optional X.509 v3 extension authority key identifier. */
|
||||
|
||||
mbedtls_x509_sequence certificate_policies; /**< Optional list of certificate policies (Only anyPolicy is printed and enforced, however the rest of the policies are still listed). */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue