summaryrefslogtreecommitdiff
path: root/tests/parse_ca.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2011-09-06 12:09:03 +0200
committerSimon Josefsson <simon@josefsson.org>2011-09-06 12:09:03 +0200
commitab782d356200f44736edb687304d5e90438e2185 (patch)
tree3fb00758567a86985a55ae9600435a1a6b279ee6 /tests/parse_ca.c
parente85153b61c44030df500314f46fe574b1dd9f884 (diff)
downloadgnutls-ab782d356200f44736edb687304d5e90438e2185.tar.gz
libgnutls: Allow CA importing of 0 certificates to succeed.
Reported by Jonathan Nieder <jrnieder@gmail.com> in <http://bugs.debian.org/640639>.
Diffstat (limited to 'tests/parse_ca.c')
-rw-r--r--tests/parse_ca.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/parse_ca.c b/tests/parse_ca.c
index 9f81887e27..42d9eb38ee 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 ();