summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-11-03 15:10:03 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-11-03 16:06:24 +0100
commitf1577004e194f414dfac8f33595051f708884d4f (patch)
treef1ef02adf966beb5a4462b30e2dc6ac0b96e9872
parentc8bb5d4417fe6c3aa28bf4940c699163acbc9cb0 (diff)
downloadgnutls-tmp-fix-pkcs11-init-issues.tar.gz
tests: list-tokens: not only list but also verify whether module is operationaltmp-fix-pkcs11-init-issues
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--tests/pkcs11/list-tokens.c15
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();
}