From 93e4f76a3e9ca2d2448525657b3e0f7b3c6ed863 Mon Sep 17 00:00:00 2001 From: toth92g Date: Tue, 11 May 2021 12:55:58 +0200 Subject: [PATCH] Adding some comments for easier understand Signed-off-by: toth92g --- library/x509_crt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/x509_crt.c b/library/x509_crt.c index 3ab219c2fb..20ca51bea7 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -784,6 +784,9 @@ static int x509_get_authority_key_id( unsigned char** p, { authority_key_id->keyIdentifier.len = len; authority_key_id->keyIdentifier.p = *p; + /* Setting tag of the keyIdentfier intentionally to 0x04. + * Although the .keyIdentfier field is CONTEXT_SPECIFIC ([0] OPTIONAL), + * its tag with the content is the payload of on OCTET STRING primitive */ authority_key_id->keyIdentifier.tag = MBEDTLS_ASN1_OCTET_STRING; *p += len; @@ -791,6 +794,7 @@ static int x509_get_authority_key_id( unsigned char** p, if ( *p < end ) { + /* Getting authorityCertIssuer using the required specific class tag [1] */ if ((ret = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | 1 ) ) != 0) { @@ -798,6 +802,7 @@ static int x509_get_authority_key_id( unsigned char** p, } else { + /* Getting directoryName using the required specific class tag [4] * if ((ret = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | 4 ) ) != 0) {