gnupg/g10 (ChangeLog card-util.c passphrase.c)

cvs user wk cvs at cvs.gnupg.org
Tue Oct 26 09:47:01 CEST 2004


    Date: Tuesday, October 26, 2004 @ 09:50:47
  Author: wk
    Path: /cvs/gnupg/gnupg/g10

Modified: ChangeLog card-util.c passphrase.c

(agent_send_all_options): Try to deduce the ttyname
from stdin.


--------------+
 ChangeLog    |   14 ++++++++++++++
 card-util.c  |   26 +++++++++++++++++++++++---
 passphrase.c |    8 ++++++--
 3 files changed, 43 insertions(+), 5 deletions(-)


Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.627 gnupg/g10/ChangeLog:1.628
--- gnupg/g10/ChangeLog:1.627	Thu Oct 21 21:18:47 2004
+++ gnupg/g10/ChangeLog	Tue Oct 26 09:50:47 2004
@@ -1,3 +1,17 @@
+2004-10-26  Werner Koch  <wk at g10code.com>
+
+	* app-openpgp.c (verify_chv3): The minimum length for CHV3 is
+	8. Changed string to match the other ones.
+
+	* passphrase.c (agent_send_all_options): Try to deduce the ttyname
+	from stdin.
+
+2004-10-22  Werner Koch  <wk at g10code.com>
+
+	* card-util.c (fetch_url): Disable for gnupg 1.9
+	(card_generate_subkey): Ditto.
+	(card_store_subkey): Ditto.
+
 2004-10-21  David Shaw  <dshaw at jabberwocky.com>
 
 	* options.h, g10.c (main), mainproc.c (check_sig_and_print):
Index: gnupg/g10/card-util.c
diff -u gnupg/g10/card-util.c:1.18 gnupg/g10/card-util.c:1.19
--- gnupg/g10/card-util.c:1.18	Thu Oct 21 18:56:22 2004
+++ gnupg/g10/card-util.c	Tue Oct 26 09:50:47 2004
@@ -523,6 +523,7 @@
 static int
 fetch_url(void)
 {
+#if GNUPG_MAJOR_VERSION == 1
   int rc;
   struct agent_card_info_s info;
 
@@ -560,6 +561,9 @@
     log_error("no URL set on card\n");
 
   return rc;
+#else
+  return 0;
+#endif
 }
 
 
@@ -577,12 +581,14 @@
       for (args++; spacep (args); args++)
         ;
       fp = fopen (args, "rb");
+#if GNUPG_MAJOR_VERSION == 1
       if (fp && is_secured_file (fileno (fp)))
         {
           fclose (fp);
           fp = NULL;
           errno = EPERM;
         }
+#endif
       if (!fp)
         {
           tty_printf (_("can't open `%s': %s\n"), args, strerror (errno));
@@ -839,6 +845,7 @@
     }
 }
 
+#if GNUPG_MAJOR_VERSION == 1
 /* Helper for the key generation/edit functions.  */
 static void
 show_card_key_info (struct agent_card_info_s *info)
@@ -851,8 +858,9 @@
   print_sha1_fpr (NULL, info->fpr3valid? info->fpr3:NULL);
   tty_printf ("\n");
 }
+#endif
 
-
+#if GNUPG_MAJOR_VERSION == 1
 /* Helper for the key generation/edit functions.  */
 static int
 replace_existing_key_p (struct agent_card_info_s *info, int keyno)
@@ -872,7 +880,7 @@
     }
   return 0;
 }
-
+#endif
 
 
 static void
@@ -898,7 +906,7 @@
   want_backup = cpr_get_answer_is_yes 
                   ( "cardedit.genkeys.backup_enc",
                     _("Make off-card backup of encryption key? (Y/n) "));
-#warning we need answer_is_yes_no_default()
+  /*FIXME: we need answer_is_yes_no_default()*/
 #endif
 
   if ( (info.fpr1valid && !fpr_is_zero (info.fpr1))
@@ -928,8 +936,12 @@
   if (check_pin_for_key_operation (&info, &forced_chv1))
     goto leave;
   
+#if GNUPG_MAJOR_VERSION == 1
   generate_keypair (NULL, info.serialno,
                     want_backup? opt.homedir:NULL);
+#else
+  generate_keypair (NULL, info.serialno);
+#endif
 
  leave:
   agent_release_card_info (&info);
@@ -942,6 +954,7 @@
 int
 card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
 {
+#if GNUPG_MAJOR_VERSION == 1
   struct agent_card_info_s info;
   int okay = 0;
   int forced_chv1 = 0;
@@ -988,6 +1001,9 @@
   agent_release_card_info (&info);
   restore_forced_chv1 (&forced_chv1);
   return okay;
+#else
+  return 0;
+#endif
 }
 
 
@@ -997,6 +1013,7 @@
 int 
 card_store_subkey (KBNODE node, int use)
 {
+#if GNUPG_MAJOR_VERSION == 1
   struct agent_card_info_s info;
   int okay = 0;
   int rc;
@@ -1117,6 +1134,9 @@
     free_secret_key (copied_sk);
   agent_release_card_info (&info);
   return okay;
+#else
+  return 0;
+#endif
 }
 
 
Index: gnupg/g10/passphrase.c
diff -u gnupg/g10/passphrase.c:1.64 gnupg/g10/passphrase.c:1.65
--- gnupg/g10/passphrase.c:1.64	Sun Oct 17 15:28:37 2004
+++ gnupg/g10/passphrase.c	Tue Oct 26 09:50:47 2004
@@ -377,9 +377,13 @@
 
   if (!opt.ttyname)
     {
+      const char *tmp;
+
       dft_ttyname = getenv ("GPG_TTY");
-      if ((!dft_ttyname || !*dft_ttyname) && tty_get_ttyname ())
-        dft_ttyname = tty_get_ttyname ();
+      if ((!dft_ttyname || !*dft_ttyname) && (tmp=ttyname (0)))
+        dft_ttyname = tmp;
+      if ((!dft_ttyname || !*dft_ttyname) && (tmp=tty_get_ttyname ()))
+        dft_ttyname = tmp;
     }
   if (opt.ttyname || dft_ttyname)
     {




More information about the Gnupg-commits mailing list