diff options
Diffstat (limited to 'tests/set_x509_pkcs12_key.c')
-rw-r--r-- | tests/set_x509_pkcs12_key.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/set_x509_pkcs12_key.c b/tests/set_x509_pkcs12_key.c index 4ef8239503..852b57ce4b 100644 --- a/tests/set_x509_pkcs12_key.c +++ b/tests/set_x509_pkcs12_key.c @@ -57,6 +57,7 @@ void doit(void) { int ret; gnutls_certificate_credentials_t xcred; + gnutls_certificate_credentials_t clicred; const char *certfile = "does-not-exist.pem"; gnutls_datum_t tcert; FILE *fp; @@ -72,8 +73,13 @@ void doit(void) gnutls_certificate_free_credentials(xcred); + assert(gnutls_certificate_allocate_credentials(&clicred) >= 0); assert(gnutls_certificate_allocate_credentials(&xcred) >= 0); + ret = gnutls_certificate_set_x509_trust_mem(clicred, &ca3_cert, GNUTLS_X509_FMT_PEM); + if (ret < 0) + fail("set_x509_trust_file failed: %s\n", gnutls_strerror(ret)); + certfile = get_tmpname(NULL); fp = fopen(certfile, "w"); @@ -99,9 +105,10 @@ void doit(void) remove(certfile); - test_cli_serv(xcred, "NORMAL", &ca3_cert, "localhost"); /* the DNS name of the first cert */ + test_cli_serv(xcred, clicred, "NORMAL", "localhost", NULL, NULL, NULL); /* the DNS name of the first cert */ gnutls_certificate_free_credentials(xcred); + gnutls_certificate_free_credentials(clicred); gnutls_global_deinit(); } |