]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
output UTF-8 decoded id-on-xmppAddr SAN's
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>
Thu, 4 Mar 2021 15:44:21 +0000 (16:44 +0100)
committerSteffen Jaeckel <jaeckel-floss@eyet-services.de>
Thu, 4 Mar 2021 15:44:21 +0000 (16:44 +0100)
tls_x509_crt_get_subject_alt_name()` makes a promise [1] "If an
otherName OID is known, the data will be decoded. ... RFC 3920
id-on-xmppAddr SAN is recognized." which it didn't hold.

Before this patch the output was still in DER format, e.g. for a
id-on-xmppAddr which is always UTF-8 (0x0c): `0x0c <len> <xmppAddr>`

This patch fixes the issue and now it returns the decoded string.

[1]
https://www.gnutls.org/manual/gnutls.html#gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
lib/x509/x509.c

index 2a5de7e93cd5d5c887cd2ec5671dc03590848f0d..c3801a83f224bbf25db0c96d7c808bdd8d2ecfa1 100644 (file)
@@ -1849,7 +1849,7 @@ get_alt_name(gnutls_subject_alt_names_t san,
                goto cleanup;
        }
 
-       if (othername_oid && type == GNUTLS_SAN_OTHERNAME && ooid.data) {
+       if (type == GNUTLS_SAN_OTHERNAME && ooid.data) {
                unsigned vtype;
                ret = gnutls_x509_othername_to_virtual((char*)ooid.data, &oname, &vtype, &virt);
                if (ret >= 0) {