summaryrefslogtreecommitdiff
path: root/src/pkcs11.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-11-08 09:30:39 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-11-08 09:30:42 +0100
commit3a181d85ff9e7abd1819fee87030d8eef96688df (patch)
treec51faeb4d8253cdc5ed4740bfd2dad621ace7cd1 /src/pkcs11.c
parentfd309b3c7e8cd34fa7a8de851b8640905d29eb73 (diff)
downloadgnutls-3a181d85ff9e7abd1819fee87030d8eef96688df.tar.gz
p11tool: introduced --only-urls option
This option allows printing a compact listing containing only of URLs.
Diffstat (limited to 'src/pkcs11.c')
-rw-r--r--src/pkcs11.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pkcs11.c b/src/pkcs11.c
index 24edee0be3..e0ede4f56e 100644
--- a/src/pkcs11.c
+++ b/src/pkcs11.c
@@ -157,7 +157,14 @@ pkcs11_list(FILE * outfile, const char *url, int type, unsigned int flags,
exit(1);
}
- fprintf(outfile, "Object %d:\n\tURL: %s\n", i, output);
+ if (info->only_urls) {
+ fprintf(outfile, "%s\n", output);
+ gnutls_free(output);
+ continue;
+ } else {
+ fprintf(outfile, "Object %d:\n\tURL: %s\n", i, output);
+ gnutls_free(output);
+ }
otype = gnutls_pkcs11_obj_get_type(crt_list[i]);
fprintf(outfile, "\tType: %s\n",