From: Simon Josefsson Date: Thu, 20 Aug 2009 10:21:09 +0000 (+0200) Subject: Fix OpenPGP hostname comparison. X-Git-Tag: gnutls_2_9_4~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9eed44b4ef9538117cc134956b32bc8fd39534fd;p=thirdparty%2Fgnutls.git Fix OpenPGP hostname comparison. --- diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c index 8018ced20a..aa2a235a23 100644 --- a/lib/openpgp/pgp.c +++ b/lib/openpgp/pgp.c @@ -589,6 +589,10 @@ gnutls_openpgp_crt_check_hostname (gnutls_openpgp_crt_t key, if (ret == 0) { + /* Length returned by gnutls_openpgp_crt_get_name includes + the terminating zero. */ + dnsnamesize--; + if (_gnutls_hostname_compare (dnsname, dnsnamesize, hostname)) return 1; }