gnupg (12 files)

cvs user wk cvs at cvs.gnupg.org
Thu Oct 21 18:53:03 CEST 2004


    Date: Thursday, October 21, 2004 @ 18:56:23
  Author: wk
    Path: /cvs/gnupg/gnupg

Modified: AUTHORS ChangeLog NEWS configure.ac g10/ChangeLog
          g10/app-common.h g10/app-openpgp.c g10/card-util.c
          include/ChangeLog include/util.h util/ChangeLog
 Removed: util/vasprintf.c

* configure.ac: Remove the check for asprintf

* app-common.h (app_openpgp_storekey: Add prototype.

* app-openpgp.c (do_sign): Replace asprintf by direct allocation.
This avoids problems with missing vasprintf implementations.

* card-util.c (generate_card_keys): Add a #warning for gnupg 1.9
and use the same string there.

* util.h [!HAVE_VASPRINTF]: Removed prototype.

* vasprintf.c: Removed. It was used only at one place and I don't
want to get into build problems in 1.4.


-------------------+
 AUTHORS           |    5 +
 ChangeLog         |    4 +
 NEWS              |    2 
 configure.ac      |    4 -
 g10/ChangeLog     |   10 +++
 g10/app-common.h  |    9 ++
 g10/app-openpgp.c |    9 ++
 g10/card-util.c   |    6 -
 include/ChangeLog |    4 +
 include/util.h    |    9 --
 util/ChangeLog    |    5 +
 util/vasprintf.c  |  169 ----------------------------------------------------
 12 files changed, 50 insertions(+), 186 deletions(-)


Index: gnupg/AUTHORS
diff -u gnupg/AUTHORS:1.35 gnupg/AUTHORS:1.36
--- gnupg/AUTHORS:1.35	Fri Oct  1 12:11:42 2004
+++ gnupg/AUTHORS	Thu Oct 21 18:56:22 2004
@@ -9,6 +9,8 @@
 
 Birger Langkjer <birger.langkjer at image.dk> Translations [da]
 
+Britov Ivanovich <maxbritov at tut.by> Translations [ru]
+
 Daniel Resare  <daniel at resare.com> Translations [sv]
 
 David Shaw <dshaw at jabberwocky.com> Assigns past and future changes.
@@ -58,6 +60,9 @@
 Paul Eggert <eggert at twinsun.com> 
     (configuration macros for LFS)
 
+Pavel I. Shajdo <zwon at severodvinsk.ru> Translations [ru]
+    (man pages)
+
 Pedro Morais <morais at poli.org> Translations [pt_PT]
 
 Rémi Guyomarch	<rguyom at mail.dotcom.fr> Assigns past and future changes.
Index: gnupg/ChangeLog
diff -u gnupg/ChangeLog:1.213 gnupg/ChangeLog:1.214
--- gnupg/ChangeLog:1.213	Fri Oct 15 15:16:58 2004
+++ gnupg/ChangeLog	Thu Oct 21 18:56:22 2004
@@ -1,3 +1,7 @@
+2004-10-21  Werner Koch  <wk at g10code.com>
+
+	* configure.ac: Remove the check for asprintf
+
 2004-10-15  Werner Koch  <wk at g10code.com>
 
 	Released 1.3.91.
Index: gnupg/NEWS
diff -u gnupg/NEWS:1.219 gnupg/NEWS:1.220
--- gnupg/NEWS:1.219	Fri Oct 15 15:46:19 2004
+++ gnupg/NEWS	Thu Oct 21 18:56:22 2004
@@ -1,5 +1,7 @@
 Noteworthy changes in version 1.3.92
 -------------------------------------------------
+    
+    * Added Russian man page. Thanks to Pawel I. Shajdo.
 
 
 Noteworthy changes in version 1.3.91 (2004-10-15)
Index: gnupg/configure.ac
diff -u gnupg/configure.ac:1.105 gnupg/configure.ac:1.106
--- gnupg/configure.ac:1.105	Fri Oct 15 15:46:19 2004
+++ gnupg/configure.ac	Thu Oct 21 18:56:22 2004
@@ -19,7 +19,7 @@
 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 dnl
 dnl (Process this file with autoconf to produce a configure script.)
-dnlAC_REVISION($Revision: 1.105 $)dnl
+dnlAC_REVISION($Revision: 1.106 $)dnl
 
 AC_PREREQ(2.59)
 min_automake_version="1.7.9"
@@ -799,7 +799,7 @@
 AC_CHECK_FUNCS(atexit raise getpagesize strftime nl_langinfo setlocale)
 AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask rand pipe stat getaddrinfo)
 AC_REPLACE_FUNCS(mkdtemp timegm)
-AC_REPLACE_FUNCS(vasprintf)
+
 AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
 
 # See if getopt is in libiberty.  This is of course not optimal since
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.625 gnupg/g10/ChangeLog:1.626
--- gnupg/g10/ChangeLog:1.625	Thu Oct 21 03:10:48 2004
+++ gnupg/g10/ChangeLog	Thu Oct 21 18:56:22 2004
@@ -1,3 +1,13 @@
+2004-10-21  Werner Koch  <wk at g10code.com>
+
+	* app-common.h (app_openpgp_storekey: Add prototype.
+
+	* app-openpgp.c (do_sign): Replace asprintf by direct allocation.
+	This avoids problems with missing vasprintf implementations.
+
+	* card-util.c (generate_card_keys): Add a #warning for gnupg 1.9
+	and use the same string there.
+
 2004-10-20  David Shaw  <dshaw at jabberwocky.com>
 
 	* g10.c (parse_list_options): Fix non-constant initializer so we
Index: gnupg/g10/app-common.h
diff -u gnupg/g10/app-common.h:1.6 gnupg/g10/app-common.h:1.7
--- gnupg/g10/app-common.h:1.6	Wed Oct 20 11:39:56 2004
+++ gnupg/g10/app-common.h	Thu Oct 21 18:56:22 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *
- * $Id: app-common.h,v 1.6 2004/10/20 09:39:56 wk Exp $
+ * $Id: app-common.h,v 1.7 2004/10/21 16:56:22 wk Exp $
  */
 
 #ifndef GNUPG_SCD_APP_COMMON_H
@@ -88,6 +88,13 @@
 #if GNUPG_MAJOR_VERSION == 1
 int app_select_openpgp (app_t app);
 int app_get_serial_and_stamp (app_t app, char **serial, time_t *stamp);
+int app_openpgp_storekey (app_t app, int keyno,
+                          unsigned char *template, size_t template_len,
+                          time_t created_at,
+                          const unsigned char *m, size_t mlen,
+                          const unsigned char *e, size_t elen,
+                          int (*pincb)(void*, const char *, char **),
+                          void *pincb_arg);
 #else
 /*-- app-help.c --*/
 gpg_error_t app_help_get_keygrip_string (ksba_cert_t cert, char *hexkeygrip);
Index: gnupg/g10/app-openpgp.c
diff -u gnupg/g10/app-openpgp.c:1.16 gnupg/g10/app-openpgp.c:1.17
--- gnupg/g10/app-openpgp.c:1.16	Wed Oct 20 11:39:56 2004
+++ gnupg/g10/app-openpgp.c	Thu Oct 21 18:56:22 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *
- * $Id: app-openpgp.c,v 1.16 2004/10/20 09:39:56 wk Exp $
+ * $Id: app-openpgp.c,v 1.17 2004/10/21 16:56:22 wk Exp $
  */
 
 #include <config.h>
@@ -1298,10 +1298,15 @@
 
       {
         char *prompt;
-        if (asprintf (&prompt, _("PIN [sigs done: %lu]"), sigcount) < 0)
+#define PROMPTSTRING  _("PIN [sigs done: %lu]")
+
+        prompt = malloc (strlen (PROMPTSTRING) + 50);
+        if (!prompt)
           return gpg_error_from_errno (errno);
+        sprintf (prompt, PROMPTSTRING, sigcount);
         rc = pincb (pincb_arg, prompt, &pinvalue); 
         free (prompt);
+#undef PROMPTSTRING
       }
       if (rc)
         {
Index: gnupg/g10/card-util.c
diff -u gnupg/g10/card-util.c:1.17 gnupg/g10/card-util.c:1.18
--- gnupg/g10/card-util.c:1.17	Wed Oct 13 20:10:06 2004
+++ gnupg/g10/card-util.c	Thu Oct 21 18:56:22 2004
@@ -895,10 +895,10 @@
     m_free(answer);
   }
 #else
-  /* Does 1.9 have answer_is_yes_no_default() ? */
-  want_backup = !(cpr_get_answer_is_yes 
+  want_backup = cpr_get_answer_is_yes 
                   ( "cardedit.genkeys.backup_enc",
-		    _("Inhibit off-card backup of encryption key? (y/N) ")));
+                    _("Make off-card backup of encryption key? (Y/n) "));
+#warning we need answer_is_yes_no_default()
 #endif
 
   if ( (info.fpr1valid && !fpr_is_zero (info.fpr1))
Index: gnupg/include/ChangeLog
diff -u gnupg/include/ChangeLog:1.76 gnupg/include/ChangeLog:1.77
--- gnupg/include/ChangeLog:1.76	Fri Oct 15 11:39:31 2004
+++ gnupg/include/ChangeLog	Thu Oct 21 18:56:22 2004
@@ -1,3 +1,7 @@
+2004-10-21  Werner Koch  <wk at g10code.com>
+
+	* util.h [!HAVE_VASPRINTF]: Removed prototype.
+
 2004-10-15  Werner Koch  <wk at g10code.com>
 
 	* util.h [!HAVE_VASPRINTF]: Add asprintf prototype.
Index: gnupg/include/util.h
diff -u gnupg/include/util.h:1.77 gnupg/include/util.h:1.78
--- gnupg/include/util.h:1.77	Fri Oct 15 11:39:31 2004
+++ gnupg/include/util.h	Thu Oct 21 18:56:22 2004
@@ -245,15 +245,6 @@
 
 /*-- Replacement functions from funcname.c --*/
 
-#if !HAVE_VASPRINTF
-int asprintf (char **result, const char *format, ...) 
-#if defined (__riscos__) \
-    || (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 ))
-			    __attribute__ ((format (printf,2,3)))
-#endif
-     ;
-
-#endif
 
 
 /******** some macros ************/
Index: gnupg/util/ChangeLog
diff -u gnupg/util/ChangeLog:1.160 gnupg/util/ChangeLog:1.161
--- gnupg/util/ChangeLog:1.160	Mon Oct 18 17:51:43 2004
+++ gnupg/util/ChangeLog	Thu Oct 21 18:56:21 2004
@@ -1,3 +1,8 @@
+2004-10-21  Werner Koch  <wk at g10code.com>
+
+	* vasprintf.c: Removed. It was used only at one place and I don't
+	want to get into build problems in 1.4. 
+
 2004-10-18  David Shaw  <dshaw at jabberwocky.com>
 
 	* http.c (connect_server, send_request): Use the URI scheme as the
Index: gnupg/util/vasprintf.c
diff -u gnupg/util/vasprintf.c:1.1 gnupg/util/vasprintf.c:removed
--- gnupg/util/vasprintf.c:1.1	Fri Oct 15 11:38:27 2004
+++ gnupg/util/vasprintf.c	Thu Oct 21 18:56:23 2004
@@ -1,169 +0,0 @@
-/* Like vsprintf but provides a pointer to malloc'd storage, which must
-   be freed by the caller.
-   Copyright (C) 1994, 2002 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#ifdef TEST
-int global_total_width;
-#endif
-
-int
-vasprintf (char **result, const char *format, va_list args)
-{
-  const char *p = format;
-  /* Add one to make sure that it is never zero, which might cause malloc
-     to return NULL.  */
-  int total_width = strlen (format) + 1;
-  va_list ap;
-
-#ifdef va_copy
-  va_copy (ap, args);
-#else
-#ifdef __va_copy
-  __va_copy (ap, args);
-#else
-  memcpy (&ap, args, sizeof (va_list));
-#endif /* __va_copy */
-#endif /* va_copy */
-
-  while (*p != '\0')
-    {
-      if (*p++ == '%')
-	{
-	  while (strchr ("-+ #0", *p))
-	    ++p;
-	  if (*p == '*')
-	    {
-	      ++p;
-	      total_width += abs (va_arg (ap, int));
-	    }
-	  else
-	    total_width += strtoul (p, (char**)&p, 10);
-	  if (*p == '.')
-	    {
-	      ++p;
-	      if (*p == '*')
-		{
-		  ++p;
-		  total_width += abs (va_arg (ap, int));
-		}
-	      else
-	      total_width += strtoul (p, (char**)&p, 10);
-	    }
-	  while (strchr ("hlL", *p))
-	    ++p;
-	  /* Should be big enough for any format specifier except %s
-             and floats.  */
-	  total_width += 30;
-	  switch (*p)
-	    {
-	    case 'd':
-	    case 'i':
-	    case 'o':
-	    case 'u':
-	    case 'x':
-	    case 'X':
-	    case 'c':
-	      (void) va_arg (ap, int);
-	      break;
-	    case 'f':
-	    case 'e':
-	    case 'E':
-	    case 'g':
-	    case 'G':
-	      (void) va_arg (ap, double);
-	      /* Since an ieee double can have an exponent of 307, we'll
-		 make the buffer wide enough to cover the gross case. */
-	      total_width += 307;
-	      break;
-	    case 's':
-              {
-                char *tmp = va_arg (ap, char *);
-                if (tmp)
-                  total_width += strlen (tmp);
-                else /* in case the vsprintf does prints a text */
-                  total_width += 25; /* e.g. "(null pointer reference)" */
-              }
-	      break;
-	    case 'p':
-	    case 'n':
-	      (void) va_arg (ap, char *);
-	      break;
-	    }
-	}
-    }
-#ifdef TEST
-  global_total_width = total_width;
-#endif
-  *result = malloc (total_width);
-  if (*result != NULL)
-    return vsprintf (*result, format, args);
-  else
-    return 0;
-}
-
-
-int
-asprintf (char **buf, const char *fmt, ...)
-{
-  int status;
-  va_list ap;
-
-  va_start (ap, fmt);
-  status = vasprintf (buf, fmt, ap);
-  va_end (ap);
-  return status;
-}
-
-
-#ifdef TEST
-void
-checkit (const char* format, ...)
-{
-  va_list args;
-  char *result;
-
-  va_start (args, format);
-  vasprintf (&result, format, args);
-  if (strlen (result) < global_total_width)
-    printf ("PASS: ");
-  else
-    printf ("FAIL: ");
-  printf ("%d %s\n", global_total_width, result);
-}
-
-int
-main (void)
-{
-  checkit ("%d", 0x12345678);
-  checkit ("%200d", 5);
-  checkit ("%.300d", 6);
-  checkit ("%100.150d", 7);
-  checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
-777777777777777777333333333333366666666666622222222222777777777777733333");
-  checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
-}
-#endif /* TEST */




More information about the Gnupg-commits mailing list