]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Only set the private status if it has been explicitly specified. That is because...
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 6 Mar 2012 09:05:29 +0000 (10:05 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 6 Mar 2012 09:15:04 +0000 (10:15 +0100)
NEWS
src/p11tool.c

diff --git a/NEWS b/NEWS
index 1280e3c71c236658e311b730851d0b63b1edecd9..1c89635a003c584efd676dcaa94566a3cb4127c4 100644 (file)
--- 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.
 
index a4e491376046976ca9d5c4de8a4e3b49fb06e48f..1ee3edf5cc1c7dbab17cdec1af118e0f89bfbc6e 100644 (file)
@@ -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))