In the --x509-username-field extenstion, we handle the subject string as
if it is a C string. Make this assumption explicit and reject incomatible
ASN.1 string types.
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
1497864520-12219-3-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=
1497864520-12219-3-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
size_t i;
char *val;
+ if (!(orig->tag == MBEDTLS_ASN1_UTF8_STRING
+ || orig->tag == MBEDTLS_ASN1_PRINTABLE_STRING
+ || orig->tag == MBEDTLS_ASN1_IA5_STRING))
+ {
+ /* Only support C-string compatible types */
+ return string_alloc("ERROR: unsupported ASN.1 string type", gc);
+ }
+
for (i = 0; i < orig->len; ++i)
{
if (orig->p[i] == '\0')