Correcting documentation issues:
- Changelog entry is Feature instead of API Change
- Correcting whitespaces around braces
- Also adding defensive mechanism to x509_get_subject_key_id
to avoid malfunction in case of trailing garbage
Signed-off-by: toth92g <toth92g@gmail.com>
diff --git a/library/x509_crt.c b/library/x509_crt.c
index e7a98dd..8cb78e5 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -608,6 +608,11 @@
*p += len;
}
+ if (*p != end) {
+ return MBEDTLS_ERR_X509_INVALID_EXTENSIONS +
+ MBEDTLS_ERR_ASN1_LENGTH_MISMATCH;
+ }
+
return 0;
}