Bug 1155901 - gnutls_certificate_get_issuer() returning zero without actually filling in the certificate pointer
Summary: gnutls_certificate_get_issuer() returning zero without actually filling in th...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gnutls
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nikos Mavrogiannopoulos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-23 06:55 UTC by Nikos Mavrogiannopoulos
Modified: 2014-11-01 16:40 UTC (History)
2 users (show)

Fixed In Version: gnutls-3.3.9-2.fc21
Clone Of:
Environment:
Last Closed: 2014-11-01 16:40:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nikos Mavrogiannopoulos 2014-10-23 06:55:58 UTC
Description of problem:

[by David Woohouse]
In F21 I seem to see gnutls_certificate_get_issuer() returning zero without
actually filling in the certificate pointer that it was given.

So this triggers:

diff --git a/gnutls.c b/gnutls.c
index 346da3c..99a5f11 100644
--- a/gnutls.c
+++ b/gnutls.c
@@ -1467,6 +1467,7 @@ static int load_certificate(struct openconnect_info *vpninfo)
                        free_issuer = 1;
                } else {
                        /* Look for it in the system trust cafile too. */
+                       issuer = (void *)0xdeadbeef;
                        err = gnutls_certificate_get_issuer(vpninfo->https_cred,
                                                            last_cert, &issuer, 0);
                        /* The check_issuer_sanity() function works fine as a workaround where
@@ -1474,7 +1475,13 @@ static int load_certificate(struct openconnect_info *vpninfo)
                           a bogus cert, there's nothing we can do to fix it up. We don't get
                           to iterate over all the available certs like we can over our own
                           list. */
-                       if (!err && check_issuer_sanity(last_cert, issuer)) {
+                       if (!err && issuer == (void *)0xdeadbeef) {
+                               /* WTF */
+                               vpn_progress(vpninfo, PRG_ERR,
+                                            _("WARNING: GnuTLS broke. wtf?\n"));
+                               break;
+                       }
+                       if (!err && issuer && check_issuer_sanity(last_cert, issuer)) {
                                vpn_progress(vpninfo, PRG_ERR,
                                             _("WARNING: GnuTLS returned incorrect issuer certs; authentication may fail!\n"));
                                break;

Comment 1 Fedora Update System 2014-10-23 07:25:59 UTC
gnutls-3.3.9-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/gnutls-3.3.9-2.fc21

Comment 2 Fedora Update System 2014-10-23 16:21:48 UTC
Package gnutls-3.3.9-2.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gnutls-3.3.9-2.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-13540/gnutls-3.3.9-2.fc21
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2014-11-01 16:40:33 UTC
gnutls-3.3.9-2.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.