diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-03-06 15:52:01 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-03-06 15:52:15 +0100 |
commit | e2ea51de4390b1cf40a57a2de342ae4880e4dc9a (patch) | |
tree | c65c462807bd302771fb425b721c65f2a2abac34 /tests/x509cert.c | |
parent | 5f404b02c113a53153a528af449ad13047b29015 (diff) | |
download | gnutls-e2ea51de4390b1cf40a57a2de342ae4880e4dc9a.tar.gz |
tests: added small test to verify that GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED succeeds with a single cert
Diffstat (limited to 'tests/x509cert.c')
-rw-r--r-- | tests/x509cert.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/x509cert.c b/tests/x509cert.c index d0d34fbf76..7cf814aaf6 100644 --- a/tests/x509cert.c +++ b/tests/x509cert.c @@ -192,6 +192,17 @@ void doit(void) /* test for gnutls_certificate_get_issuer() */ + /* check whether gnutls_x509_crt_list_import will fail if given a single + * certificate */ + list_size = LIST_SIZE; + ret = + gnutls_x509_crt_list_import(list, &list_size, &ca, + GNUTLS_X509_FMT_PEM, + GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED); + if (ret < 0) + fail("gnutls_x509_crt_list_import (failed with a single cert)"); + gnutls_x509_crt_deinit(list[0]); + list_size = LIST_SIZE; ret = gnutls_x509_crt_list_import(list, &list_size, &cert, |