summaryrefslogtreecommitdiff
path: root/tests/x509cert-tl.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-03-05 21:28:56 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-03-05 21:28:56 +0100
commit5eb64ff2eab8dc02876123e21d1230808fe75008 (patch)
tree18c4703b963b9d9667017e07be5b8369dfd721a8 /tests/x509cert-tl.c
parenta683cf2fe89c15c8d0ebba35cdbbeeee6e4e417a (diff)
downloadgnutls-5eb64ff2eab8dc02876123e21d1230808fe75008.tar.gz
Added functions that remove certificates from a trust list.
Diffstat (limited to 'tests/x509cert-tl.c')
-rw-r--r--tests/x509cert-tl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/x509cert-tl.c b/tests/x509cert-tl.c
index 2753daa185..08f25b36ea 100644
--- a/tests/x509cert-tl.c
+++ b/tests/x509cert-tl.c
@@ -249,12 +249,28 @@ doit (void)
if (ret < 1)
fail("gnutls_x509_trust_list_add_trust_mem: %d (%s)\n", __LINE__, gnutls_strerror(ret));
+ ret = gnutls_x509_trust_list_remove_trust_mem(tl, &data, GNUTLS_X509_FMT_PEM);
+ if (ret < 1)
+ fail("gnutls_x509_trust_list_add_trust_mem: %d (%s)\n", __LINE__, gnutls_strerror(ret));
+
data.data = cert_der;
data.size = sizeof(cert_der);
ret = gnutls_x509_trust_list_add_trust_mem(tl, &data, NULL, GNUTLS_X509_FMT_DER, 0, 0);
if (ret < 1)
fail("gnutls_x509_trust_list_add_trust_mem: %d (%s)\n", __LINE__, gnutls_strerror(ret));
+ ret = gnutls_x509_trust_list_remove_trust_mem(tl, &data, GNUTLS_X509_FMT_DER);
+ if (ret < 1)
+ fail("gnutls_x509_trust_list_add_trust_mem: %d (%s)\n", __LINE__, gnutls_strerror(ret));
+
+ ret = gnutls_x509_trust_list_remove_cas(tl, &ca_crt, 1);
+ if (ret < 1)
+ fail("gnutls_x509_trust_list_add_cas");
+
+ ret = gnutls_x509_trust_list_verify_crt(tl, &server_crt, 1, 0, &status, NULL);
+ if (ret == 0 && status == 0)
+ fail("gnutls_x509_trust_list_verify_crt\n");
+
gnutls_x509_trust_list_deinit(tl, 1);
gnutls_global_deinit();