]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: added small test to verify that GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED succeeds...
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 6 Mar 2015 14:52:01 +0000 (15:52 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 6 Mar 2015 14:52:15 +0000 (15:52 +0100)
tests/x509cert.c

index d0d34fbf76ef575b6e4f2fed591db6b7254681a1..7cf814aaf6e60ca646fe4860d29b48df33fee401 100644 (file)
@@ -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,