From: Nikos Mavrogiannopoulos Date: Sun, 25 Nov 2012 14:24:47 +0000 (+0100) Subject: UniversalString (UTF-32) is handled as non-printable for now. X-Git-Tag: gnutls_3_1_6~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9be61b784a901c6cf434ee94b790acbed0f4a401;p=thirdparty%2Fgnutls.git UniversalString (UTF-32) is handled as non-printable for now. --- diff --git a/lib/x509/common.c b/lib/x509/common.c index b97fc06c3a..594ad0f725 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -223,7 +223,7 @@ size_t size; printable = 1; } } - else + else if (etype != ASN1_ETYPE_UNIVERSAL_STRING) /* supported but not printable */ return GNUTLS_E_INVALID_REQUEST; if (printable == 0) @@ -258,7 +258,7 @@ decode_complex_string (const struct oid_to_string* oentry, void *value, int len = -1, result; ASN1_TYPE tmpasn = ASN1_TYPE_EMPTY; char asn1_err[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = ""; - int etype = ASN1_ETYPE_INVALID; + unsigned int etype; gnutls_datum_t td; if (oentry->asn_desc == NULL) @@ -297,14 +297,16 @@ decode_complex_string (const struct oid_to_string* oentry, void *value, str[len] = 0; - /* Note that we do not support strings other than - * UTF-8 (thus ASCII as well). - */ + /* We set the etype on the strings that may need + * some conversion to UTF-8. The INVALID flag indicates + * no conversion needed */ if (strcmp (str, "teletexString") == 0) etype = ASN1_ETYPE_TELETEX_STRING; - - if (strcmp (str, "bmpString") == 0) + else if (strcmp (str, "bmpString") == 0) etype = ASN1_ETYPE_BMP_STRING; + else if (strcmp (str, "universalString") == 0) + etype = ASN1_ETYPE_UNIVERSAL_STRING; + else etype = ASN1_ETYPE_INVALID; _gnutls_str_cpy (tmpname, sizeof (tmpname), str);