From: Nikos Mavrogiannopoulos Date: Tue, 6 Mar 2012 09:05:29 +0000 (+0100) Subject: Only set the private status if it has been explicitly specified. That is because... X-Git-Tag: gnutls_3_0_16~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15c2eb673385bfc9eb79d6479b414bfd5524a13a;p=thirdparty%2Fgnutls.git Only set the private status if it has been explicitly specified. That is because some tokens don't want it set. --- diff --git a/NEWS b/NEWS index 1280e3c71c..1c89635a00 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ See the end for copying conditions. ** Corrected SRP-RSA ciphersuites when used under TLS 1.2. +** Small fixes in p11tool handling of the --private command +line option. + ** API and ABI modifications: No changes since last version. 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))