From: Nikos Mavrogiannopoulos Date: Fri, 6 Mar 2015 14:52:01 +0000 (+0100) Subject: tests: added small test to verify that GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED succeeds... X-Git-Tag: gnutls_3_4_0~234 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2ea51de4390b1cf40a57a2de342ae4880e4dc9a;p=thirdparty%2Fgnutls.git tests: added small test to verify that GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED succeeds with a single cert --- 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,