diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-12-03 10:49:12 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-12-03 20:32:15 +0100 |
commit | ff8d2195228bbd9556e050124ce1ad32337bc772 (patch) | |
tree | 0a9db601c755fb93f3ccb6869462b90e62fc8091 /tests/pkcs11 | |
parent | 752a21f88e2bea8e4bfaf2690fabf3868c4a6d52 (diff) | |
download | gnutls-ff8d2195228bbd9556e050124ce1ad32337bc772.tar.gz |
tests: p11-kit-load.sh: verify that all modules are loaded after a private key operation
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'tests/pkcs11')
-rw-r--r-- | tests/pkcs11/list-tokens.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/pkcs11/list-tokens.c b/tests/pkcs11/list-tokens.c index 6929b2381b..cc4326d901 100644 --- a/tests/pkcs11/list-tokens.c +++ b/tests/pkcs11/list-tokens.c @@ -58,7 +58,9 @@ int main(int argc, char **argv) char *url; gnutls_x509_trust_list_t tl; gnutls_x509_crt_t crt; + gnutls_pkcs11_privkey_t key; unsigned flag = 1; + unsigned private = 0; unsigned int status; ret = gnutls_global_init(); @@ -70,7 +72,7 @@ int main(int argc, char **argv) gnutls_global_set_log_function(tls_log_func); //gnutls_global_set_log_level(4711); - while((opt = getopt(argc, argv, "mvatd")) != -1) { + while((opt = getopt(argc, argv, "mvatdp")) != -1) { switch(opt) { case 'm': /* initialize manually - i.e., do no module loading */ @@ -85,6 +87,12 @@ int main(int argc, char **argv) * if none done */ flag = 0; break; + case 'p': + /* do private key operations */ + assert(gnutls_pkcs11_privkey_init(&key) >= 0); + gnutls_pkcs11_privkey_import_url(key, "pkcs11:", 0); + gnutls_pkcs11_privkey_deinit(key); + break; case 'a': /* initialize auto - i.e., do module loading */ ret = gnutls_pkcs11_init(GNUTLS_PKCS11_FLAG_AUTO, NULL); |