summaryrefslogtreecommitdiff
path: root/lib/openpgp/pgp.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-08-20 12:21:09 +0200
committerSimon Josefsson <simon@josefsson.org>2009-08-20 12:21:09 +0200
commit9eed44b4ef9538117cc134956b32bc8fd39534fd (patch)
tree48eeefab0b731583953ba99945ccec55a9fecc64 /lib/openpgp/pgp.c
parenta4e5f6581c55aee85cc805081a8b4171c326da5a (diff)
downloadgnutls-9eed44b4ef9538117cc134956b32bc8fd39534fd.tar.gz
Fix OpenPGP hostname comparison.
Diffstat (limited to 'lib/openpgp/pgp.c')
-rw-r--r--lib/openpgp/pgp.c4
1 files changed, 4 insertions, 0 deletions
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;
}