diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-11-03 15:10:03 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-11-03 16:11:00 +0000 |
commit | 7c2b903b0e7fb88a2e88aa976496d54c28fb87a0 (patch) | |
tree | e02f32c1fe5702ea31192079a74bf03c0e62776a | |
parent | 12f4abc02e718e2ab0f7ae80b3026a29028536e7 (diff) | |
download | gnutls-7c2b903b0e7fb88a2e88aa976496d54c28fb87a0.tar.gz |
tests: list-tokens: not only list but also verify whether module is operational
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | tests/pkcs11/list-tokens.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pkcs11/list-tokens.c b/tests/pkcs11/list-tokens.c index 42092b45f9..220b9de763 100644 --- a/tests/pkcs11/list-tokens.c +++ b/tests/pkcs11/list-tokens.c @@ -119,5 +119,20 @@ int main(int argc, char **argv) free(url); } + /* try whether these URIs are operational */ + for (i=0;;i++) { + unsigned tflags; + + ret = _gnutls_pkcs11_token_get_url(i, 0, &url, flag); + if (ret < 0) + break; + ret = gnutls_pkcs11_token_get_flags(url, &tflags); + if (ret < 0) { + fprintf(stderr, "cannot get token %s flags: %s\n", url, gnutls_strerror(ret)); + exit(1); + } + free(url); + } + gnutls_global_deinit(); } |