From 3aa121660ea80297430bddd08dea687e61e82fa1 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 2 Jul 2019 16:47:40 +0100 Subject: [PATCH] Add comment about X.509 name comparison of buffer with itself --- library/x509_crt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/x509_crt.c b/library/x509_crt.c index 59898f724..61e4a9e22 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -1283,6 +1283,7 @@ static int x509_crt_parse_frame( unsigned char *start, p += len; frame->issuer_raw.len = p - frame->issuer_raw.p; + /* Comparing the raw buffer to itself amounts to structural validation. */ ret = mbedtls_x509_name_cmp_raw( &frame->issuer_raw, &frame->issuer_raw, NULL, NULL ); @@ -1313,6 +1314,7 @@ static int x509_crt_parse_frame( unsigned char *start, p += len; frame->subject_raw.len = p - frame->subject_raw.p; + /* Comparing the raw buffer to itself amounts to structural validation. */ ret = mbedtls_x509_name_cmp_raw( &frame->subject_raw, &frame->subject_raw, NULL, NULL );