gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_2-12-gab782d3


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_2-12-gab782d3
Date: Tue, 06 Sep 2011 10:09:25 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=ab782d356200f44736edb687304d5e90438e2185

The branch, master has been updated
       via  ab782d356200f44736edb687304d5e90438e2185 (commit)
      from  e85153b61c44030df500314f46fe574b1dd9f884 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ab782d356200f44736edb687304d5e90438e2185
Author: Simon Josefsson <address@hidden>
Date:   Tue Sep 6 12:09:03 2011 +0200

    libgnutls: Allow CA importing of 0 certificates to succeed.
    
    Reported by Jonathan Nieder <address@hidden> in
    <http://bugs.debian.org/640639>.

-----------------------------------------------------------------------

Summary of changes:
 NEWS             |    4 ++++
 lib/x509/x509.c  |    4 +++-
 tests/parse_ca.c |    9 ++++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 4d787a3..419bb85 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ GnuTLS NEWS -- History of user-visible changes.                
-*- outline -*-
 Copyright (C) 2000-2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
+** libgnutls: Allow CA importing of 0 certificates to succeed.
+Reported by Jonathan Nieder <address@hidden> in
+<http://bugs.debian.org/640639>.
+
 * Version 3.0.2 (released 2011-09-01)
 
 ** libgnutls: OpenPGP certificate type is not enabled
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 606d44f..9d85384 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -3219,7 +3219,9 @@ gnutls_x509_crt_list_import (gnutls_x509_crt_t * certs,
   if (ptr == NULL)
     {
       gnutls_assert ();
-      return GNUTLS_E_BASE64_DECODING_ERROR;
+      *cert_max = 0;
+      /* no certificate found, likely empty file or garbage input */
+      return 0;
     }
 
   count = 0;
diff --git a/tests/parse_ca.c b/tests/parse_ca.c
index 9f81887..42d9eb3 100644
--- a/tests/parse_ca.c
+++ b/tests/parse_ca.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
  *
  * Author: Simon Josefsson
  *
@@ -72,6 +72,13 @@ doit (void)
   if (rc != 2)
     fail ("import ca failed: %d\n", rc);
 
+  ca.data = (unsigned char*) "";
+  ca.size = 0;
+
+  rc = gnutls_certificate_set_x509_trust_mem (cred, &ca, GNUTLS_X509_FMT_PEM);
+  if (rc != 0)
+    fail ("import ca failed: %d\n", rc);
+
   gnutls_certificate_free_credentials (cred);
 
   gnutls_global_deinit ();


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]