Reject null bytes in DER encoded values in DNs

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
diff --git a/library/x509_create.c b/library/x509_create.c
index 66f6806..8a648e3 100644
--- a/library/x509_create.c
+++ b/library/x509_create.c
@@ -239,6 +239,9 @@
         if ((c + 1 >= end) || (n = hexpair_to_int(*c, *(c+1))) == -1) {
             return MBEDTLS_ERR_X509_INVALID_NAME;
         }
+        if (MBEDTLS_ASN1_IS_STRING_TAG(*tag) && n == 0) {
+            return MBEDTLS_ERR_X509_INVALID_NAME;
+        }
         *(p++) = n;
     }
     asn1_der_end = p;