diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-03-06 10:05:29 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-03-06 10:15:04 +0100 |
commit | 15c2eb673385bfc9eb79d6479b414bfd5524a13a (patch) | |
tree | 727a334fac2e0f5fe63d7350b635026b5a354004 /src/p11tool.c | |
parent | addee7cdf78578a0717725157a62dec948bf76a9 (diff) | |
download | gnutls-15c2eb673385bfc9eb79d6479b414bfd5524a13a.tar.gz |
Only set the private status if it has been explicitly specified. That is because some tokens don't want it set.
Diffstat (limited to 'src/p11tool.c')
-rw-r--r-- | src/p11tool.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/p11tool.c b/src/p11tool.c index a4e4913760..1ee3edf5cc 100644 --- a/src/p11tool.c +++ b/src/p11tool.c @@ -176,7 +176,7 @@ cmd_parser (int argc, char **argv) if (debug > 0) { - fprintf(stderr, "Private: %s\n", ENABLED_OPT(PRIVATE)?"yes":"no"); + if (HAVE_OPT(PRIVATE)) fprintf(stderr, "Private: %s\n", ENABLED_OPT(PRIVATE)?"yes":"no"); fprintf(stderr, "Trusted: %s\n", ENABLED_OPT(TRUSTED)?"yes":"no"); fprintf(stderr, "Login: %s\n", ENABLED_OPT(LOGIN)?"yes":"no"); fprintf(stderr, "Detailed URLs: %s\n", ENABLED_OPT(DETAILED_URL)?"yes":"no"); @@ -225,8 +225,15 @@ cmd_parser (int argc, char **argv) pkcs11_export (outfile, url, login, &cinfo); } else if (HAVE_OPT(WRITE)) - pkcs11_write (outfile, url, label, - ENABLED_OPT(TRUSTED), ENABLED_OPT(PRIVATE), login, &cinfo); + { + int priv; + + if (HAVE_OPT(PRIVATE)) + priv = ENABLED_OPT(PRIVATE); + else priv = -1; + pkcs11_write (outfile, url, label, + ENABLED_OPT(TRUSTED), priv, login, &cinfo); + } else if (HAVE_OPT(INITIALIZE)) pkcs11_init (outfile, url, label, &cinfo); else if (HAVE_OPT(DELETE)) |