Add mbedtls_x509_dn_get_next function
Allow iteration through relative DNs when X509 name contains multi-
value RDNs.
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
diff --git a/library/x509.c b/library/x509.c
index 2e11c7f..17d1030 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -797,6 +797,15 @@
}
/*
+ * Return the next relative DN in an X509 name.
+ */
+mbedtls_x509_name * mbedtls_x509_dn_get_next( mbedtls_x509_name * dn )
+{
+ for( ; dn->next != NULL && dn->next_merged; dn = dn->next );
+ return( dn->next );
+}
+
+/*
* Store the serial in printable form into buf; no more
* than size characters will be written
*/