diff options
author | Tim Kosse <tim.kosse@filezilla-project.org> | 2016-07-09 13:03:55 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-07-28 10:54:15 +0200 |
commit | b60866e95efcdbfb9a931600dbf69bc78e7d82e2 (patch) | |
tree | 5d27152110b9daa250855554c3b284e09e7d7e6e | |
parent | 9c6741d096f1069bdc8eec5caff15e794dc4a13f (diff) | |
download | gnutls-tim-patches.tar.gz |
Add test for gnutls_x509_crt_list_import2 with flag GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED.tim-patches
-rw-r--r-- | tests/chainverify-unsorted.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/chainverify-unsorted.c b/tests/chainverify-unsorted.c index 829b13636f..8dc99bbbd9 100644 --- a/tests/chainverify-unsorted.c +++ b/tests/chainverify-unsorted.c @@ -654,6 +654,17 @@ void doit(void) /* Chain 2 */ data.data = (void *) chain2; data.size = sizeof(chain2); + + /* verify whether the GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED flag is + * considered by gnutls_x509_crt_list_import2() */ + ret = + gnutls_x509_crt_list_import2(&crts, &crts_size, &data, + GNUTLS_X509_FMT_PEM, GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED); + if (ret != GNUTLS_E_CERTIFICATE_LIST_UNSORTED) { + fail("gnutls_x509_crt_list_import2 with flag GNUTLS_E_CERTIFICATE_LIST_UNSORTED on unsorted chain didn't fail: %s\n", gnutls_strerror(ret)); + exit(1); + } + ret = gnutls_x509_crt_list_import2(&crts, &crts_size, &data, GNUTLS_X509_FMT_PEM, 0); |