[git] GnuPG - branch, master, updated. gnupg-2.1.1-54-g382ba4b

by Werner Koch cvs at cvs.gnupg.org
Wed Jan 28 20:39:14 CET 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  382ba4b137b42d5f25a7e256bb7c053ee5ac7b64 (commit)
       via  d8eea25b8b7becbfa3f059be6f5966a2f1aa7112 (commit)
       via  0c2bfd9d5a49a6134188f8f7820f6ccdebd9f181 (commit)
      from  b1d5ed6ac842469afcb84868d0f6641dc286a6c7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 382ba4b137b42d5f25a7e256bb7c053ee5ac7b64
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 28 20:32:28 2015 +0100

    gpg: Limit the size of key packets to a sensible value.
    
    * g10/parse-packet.c (MAX_KEY_PACKET_LENGTH): New.
    (MAX_UID_PACKET_LENGTH): New.
    (MAX_COMMENT_PACKET_LENGTH): New.
    (MAX_ATTR_PACKET_LENGTH): New.
    (parse_key): Limit the size of a key packet to 256k.
    (parse_user_id): Use macro for the packet size limit.
    (parse_attribute): Ditto.
    (parse_comment): Ditto.
    --
    
    Without that it is possible to force gpg to allocate large amounts of
    memory by using a bad encoded MPI.  This would be an too easy DoS.
    Another way to mitigate would be to change the MPI read function to
    allocate memory dynamically while reading the MPI.  However, that
    complicates and possibly slows down the code.  A too large key packet
    is in any case a sign for broken data and thus gpg should not use it.
    
    Reported-by: Hanno Böck
    GnuPG-bug-id: 1823
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 73c4434..524fabe 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -35,6 +35,14 @@
 #include "main.h"
 #include "i18n.h"
 
+
+/* Maximum length of packets to avoid excessive memory allocation.  */
+#define MAX_KEY_PACKET_LENGTH     (256 * 1024)
+#define MAX_UID_PACKET_LENGTH     (  2 * 1024)
+#define MAX_COMMENT_PACKET_LENGTH ( 64 * 1024)
+#define MAX_ATTR_PACKET_LENGTH    ( 16 * 1024*1024)
+
+
 static int mpi_print_mode;
 static int list_mode;
 static estream_t listfp;
@@ -1983,6 +1991,14 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
       err = gpg_error (GPG_ERR_INV_PACKET);
       goto leave;
     }
+  else if (pktlen > MAX_KEY_PACKET_LENGTH)
+    {
+      log_error ("packet(%d) too large\n", pkttype);
+      if (list_mode)
+        es_fputs (":key packet: [too larget]\n", listfp);
+      err = gpg_error (GPG_ERR_INV_PACKET);
+      goto leave;
+    }
 
   timestamp = read_32 (inp);
   pktlen -= 4;
@@ -2415,7 +2431,7 @@ parse_user_id (IOBUF inp, int pkttype, unsigned long pktlen, PACKET * packet)
      allocatable, and a very large pktlen could actually cause our
      allocation to wrap around in xmalloc to a small number. */
 
-  if (pktlen > 2048)
+  if (pktlen > MAX_UID_PACKET_LENGTH)
     {
       log_error ("packet(%d) too large\n", pkttype);
       if (list_mode)
@@ -2496,7 +2512,7 @@ parse_attribute (IOBUF inp, int pkttype, unsigned long pktlen,
   /* We better cap the size of an attribute packet to make DoS not too
      easy.  16MB should be more then enough for one attribute packet
      (ie. a photo).  */
-  if (pktlen > 16*1024*1024)
+  if (pktlen > MAX_ATTR_PACKET_LENGTH)
     {
       log_error ("packet(%d) too large\n", pkttype);
       if (list_mode)
@@ -2540,7 +2556,7 @@ parse_comment (IOBUF inp, int pkttype, unsigned long pktlen, PACKET * packet)
      overflow in the malloc below.  Comment packets are actually not
      anymore define my OpenPGP and we even stopped to use our
      private comment packet.  */
-  if (pktlen > 65536)
+  if (pktlen > MAX_COMMENT_PACKET_LENGTH)
     {
       log_error ("packet(%d) too large\n", pkttype);
       if (list_mode)

commit d8eea25b8b7becbfa3f059be6f5966a2f1aa7112
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 28 20:12:21 2015 +0100

    gpg: Fix buffering problem in --list-config.
    
    * g10/gpg.c (list_config): Replace print_sanitized_string2 by
    es_write_sanitized.
    
    * common/stringhelp.c (print_sanitized_buffer2): Remove.
    (print_sanitized_buffer, print_sanitized_utf8_buffer): Remove.
    (print_sanitized_utf8_buffer, print_sanitized_utf8_string): Remove.
    (print_sanitized_string): Remove.
    
    * sm/certdump.c (print_dn_part, print_dn_parts): Remove arg FP.
    (pretty_print_sexp, gpgsm_print_name2, gpgsm_print_name): Remove.
    --
    
    Mixing stdio and estream is never a good idea.  This fix also allows
    us to remove a lot of garbage.
    
    Reported-by: Jason A. Donenfeld <Jason at zx2c4.com>
    GnuPG-bug-id: 1822
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/stringhelp.c b/common/stringhelp.c
index 7ce041d..7128de5 100644
--- a/common/stringhelp.c
+++ b/common/stringhelp.c
@@ -671,129 +671,6 @@ hextobyte (const char *s)
 }
 
 
-/* Print a BUFFER to stream FP while replacing all control characters
-   and the characters DELIM and DELIM2 with standard C escape
-   sequences.  Returns the number of characters printed. */
-size_t
-print_sanitized_buffer2 (FILE *fp, const void *buffer, size_t length,
-                         int delim, int delim2)
-{
-  const unsigned char *p = buffer;
-  size_t count = 0;
-
-  for (; length; length--, p++, count++)
-    {
-      if (*p < 0x20
-          || *p == 0x7f
-          || *p == delim
-          || *p == delim2
-          || ((delim || delim2) && *p=='\\'))
-        {
-          putc ('\\', fp);
-          count++;
-          if (*p == '\n')
-            {
-              putc ('n', fp);
-              count++;
-            }
-          else if (*p == '\r')
-            {
-              putc ('r', fp);
-              count++;
-            }
-          else if (*p == '\f')
-            {
-              putc ('f', fp);
-              count++;
-            }
-          else if (*p == '\v')
-            {
-              putc ('v', fp);
-              count++;
-            }
-          else if (*p == '\b')
-            {
-              putc ('b', fp);
-              count++;
-            }
-          else if (!*p)
-            {
-              putc('0', fp);
-              count++;
-            }
-          else
-            {
-              fprintf (fp, "x%02x", *p);
-              count += 3;
-            }
-	}
-      else
-        {
-          putc (*p, fp);
-          count++;
-        }
-    }
-
-  return count;
-}
-
-/* Same as print_sanitized_buffer2 but with just one delimiter. */
-size_t
-print_sanitized_buffer (FILE *fp, const void *buffer, size_t length,
-                        int delim)
-{
-  return print_sanitized_buffer2 (fp, buffer, length, delim, 0);
-}
-
-
-size_t
-print_sanitized_utf8_buffer (FILE *fp, const void *buffer,
-                             size_t length, int delim)
-{
-  const char *p = buffer;
-  size_t i;
-
-  /* We can handle plain ascii simpler, so check for it first. */
-  for (i=0; i < length; i++ )
-    {
-      if ( (p[i] & 0x80) )
-        break;
-    }
-  if (i < length)
-    {
-	char *buf = utf8_to_native (p, length, delim);
-	/*(utf8 conversion already does the control character quoting)*/
-        i = strlen (buf);
-	fputs (buf, fp);
-	jnlib_free (buf);
-        return i;
-    }
-  else
-    return print_sanitized_buffer (fp, p, length, delim);
-}
-
-
-size_t
-print_sanitized_string2 (FILE *fp, const char *string, int delim, int delim2)
-{
-  return string? print_sanitized_buffer2 (fp, string, strlen (string),
-                                          delim, delim2):0;
-}
-
-size_t
-print_sanitized_string (FILE *fp, const char *string, int delim)
-{
-  return string? print_sanitized_buffer (fp, string, strlen (string), delim):0;
-}
-
-size_t
-print_sanitized_utf8_string (FILE *fp, const char *string, int delim)
-{
-  return string? print_sanitized_utf8_buffer (fp,
-                                              string, strlen (string),
-                                              delim) : 0;
-}
-
 /* Create a string from the buffer P_ARG of length N which is suitable
    for printing.  Caller must release the created string using xfree.
    This function terminates the process on memory shortage.  */
diff --git a/common/stringhelp.h b/common/stringhelp.h
index 1d3ee72..d4fe169 100644
--- a/common/stringhelp.h
+++ b/common/stringhelp.h
@@ -60,16 +60,6 @@ int compare_filenames( const char *a, const char *b );
 
 int hextobyte (const char *s);
 
-size_t print_sanitized_buffer (FILE *fp, const void *buffer, size_t length,
-                               int delim);
-size_t print_sanitized_buffer2 (FILE *fp, const void *buffer, size_t length,
-                                int delim, int delim2);
-size_t print_sanitized_utf8_buffer (FILE *fp, const void *buffer,
-                                    size_t length, int delim);
-size_t print_sanitized_string (FILE *fp, const char *string, int delim);
-size_t print_sanitized_string2 (FILE *fp, const char *string,
-                                int delim, int delim2);
-size_t print_sanitized_utf8_string (FILE *fp, const char *string, int delim);
 char *sanitize_buffer (const void *p, size_t n, int delim);
 
 
diff --git a/g10/gpg.c b/g10/gpg.c
index 5e929d9..9a6b104 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1599,7 +1599,8 @@ list_config(char *items)
 
 	      for(sl=iter->values;sl;sl=sl->next)
 		{
-		  print_sanitized_string2 (stdout, sl->d, ':',';');
+		  es_write_sanitized (es_stdout, sl->d, strlen (sl->d),
+                                      ":;", NULL);
 		  if(sl->next)
                     es_printf(";");
 		}
diff --git a/sm/certdump.c b/sm/certdump.c
index 23cca73..f32a27c 100644
--- a/sm/certdump.c
+++ b/sm/certdump.c
@@ -479,9 +479,9 @@ parse_dn (const unsigned char *string)
 }
 
 
-/* Print a DN part to STREAM or if STREAM is NULL to FP. */
+/* Print a DN part to STREAM. */
 static void
-print_dn_part (FILE *fp, estream_t stream,
+print_dn_part (estream_t stream,
                struct dn_array_s *dn, const char *key, int translate)
 {
   struct dn_array_s *first_dn = dn;
@@ -500,24 +500,13 @@ print_dn_part (FILE *fp, estream_t stream,
         next:
           if (!dn->done && dn->value && *dn->value)
             {
-              if (stream)
-                {
-                  es_fprintf (stream, "/%s=", dn->key);
-                  if (translate)
-                    print_utf8_buffer3 (stream, dn->value, strlen (dn->value),
-                                         "/");
-                  else
-                    es_write_sanitized (stream, dn->value, strlen (dn->value),
-                                        "/", NULL);
-                }
+              es_fprintf (stream, "/%s=", dn->key);
+              if (translate)
+                print_utf8_buffer3 (stream, dn->value, strlen (dn->value),
+                                    "/");
               else
-                {
-                  fprintf (fp, "/%s=", dn->key);
-                  if (translate)
-                    print_sanitized_utf8_string (fp, dn->value, '/');
-                  else
-                    print_sanitized_string (fp, dn->value, '/');
-                }
+                es_write_sanitized (stream, dn->value, strlen (dn->value),
+                                    "/", NULL);
             }
           dn->done = 1;
           if (dn > first_dn && dn[-1].multivalued)
@@ -532,7 +521,7 @@ print_dn_part (FILE *fp, estream_t stream,
 /* Print all parts of a DN in a "standard" sequence.  We first print
    all the known parts, followed by the uncommon ones */
 static void
-print_dn_parts (FILE *fp, estream_t stream,
+print_dn_parts (estream_t stream,
                 struct dn_array_s *dn, int translate)
 {
   const char *stdpart[] = {
@@ -541,59 +530,14 @@ print_dn_parts (FILE *fp, estream_t stream,
   int i;
 
   for (i=0; stdpart[i]; i++)
-      print_dn_part (fp, stream, dn, stdpart[i], translate);
+      print_dn_part (stream, dn, stdpart[i], translate);
 
   /* Now print the rest without any specific ordering */
   for (; dn->key; dn++)
-    print_dn_part (fp, stream, dn, dn->key, translate);
+    print_dn_part (stream, dn, dn->key, translate);
 }
 
 
-/* Print the S-Expression in BUF, which has a valid length of BUFLEN,
-   as a human readable string in one line to FP. */
-static void
-pretty_print_sexp (FILE *fp, const unsigned char *buf, size_t buflen)
-{
-  size_t len;
-  gcry_sexp_t sexp;
-  char *result, *p;
-
-  if ( gcry_sexp_sscan (&sexp, NULL, (const char*)buf, buflen) )
-    {
-      fputs (_("[Error - invalid encoding]"), fp);
-      return;
-    }
-  len = gcry_sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, NULL, 0);
-  assert (len);
-  result = xtrymalloc (len);
-  if (!result)
-    {
-      fputs (_("[Error - out of core]"), fp);
-      gcry_sexp_release (sexp);
-      return;
-    }
-  len = gcry_sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, result, len);
-  assert (len);
-  for (p = result; len; len--, p++)
-    {
-      if (*p == '\n')
-        {
-          if (len > 1) /* Avoid printing the trailing LF. */
-            fputs ("\\n", fp);
-        }
-      else if (*p == '\r')
-        fputs ("\\r", fp);
-      else if (*p == '\v')
-        fputs ("\\v", fp);
-      else if (*p == '\t')
-        fputs ("\\t", fp);
-      else
-        putc (*p, fp);
-    }
-  xfree (result);
-  gcry_sexp_release (sexp);
-}
-
 /* Print the S-Expression in BUF to extended STREAM, which has a valid
    length of BUFLEN, as a human readable string in one line to FP. */
 static void
@@ -640,63 +584,6 @@ pretty_es_print_sexp (estream_t fp, const unsigned char *buf, size_t buflen)
 }
 
 
-
-
-void
-gpgsm_print_name2 (FILE *fp, const char *name, int translate)
-{
-  const unsigned char *s = (const unsigned char *)name;
-  int i;
-
-  if (!s)
-    {
-      fputs (_("[Error - No name]"), fp);
-    }
-  else if (*s == '<')
-    {
-      const char *s2 = strchr ( (char*)s+1, '>');
-      if (s2)
-        {
-          if (translate)
-            print_sanitized_utf8_buffer (fp, s + 1, s2 - (char*)s - 1, 0);
-          else
-            print_sanitized_buffer (fp, s + 1, s2 - (char*)s - 1, 0);
-        }
-    }
-  else if (*s == '(')
-    {
-      pretty_print_sexp (fp, s, gcry_sexp_canon_len (s, 0, NULL, NULL));
-    }
-  else if (!((*s >= '0' && *s < '9')
-             || (*s >= 'A' && *s <= 'Z')
-             || (*s >= 'a' && *s <= 'z')))
-    fputs (_("[Error - invalid encoding]"), fp);
-  else
-    {
-      struct dn_array_s *dn = parse_dn (s);
-      if (!dn)
-        fputs (_("[Error - invalid DN]"), fp);
-      else
-        {
-          print_dn_parts (fp, NULL, dn, translate);
-          for (i=0; dn[i].key; i++)
-            {
-              xfree (dn[i].key);
-              xfree (dn[i].value);
-            }
-          xfree (dn);
-        }
-    }
-}
-
-
-void
-gpgsm_print_name (FILE *fp, const char *name)
-{
-  gpgsm_print_name2 (fp, name, 1);
-}
-
-
 /* This is a variant of gpgsm_print_name sending it output to an estream. */
 void
 gpgsm_es_print_name2 (estream_t fp, const char *name, int translate)
@@ -736,7 +623,7 @@ gpgsm_es_print_name2 (estream_t fp, const char *name, int translate)
         es_fputs (_("[Error - invalid DN]"), fp);
       else
         {
-          print_dn_parts (NULL, fp, dn, translate);
+          print_dn_parts (fp, dn, translate);
           for (i=0; dn[i].key; i++)
             {
               xfree (dn[i].key);

commit 0c2bfd9d5a49a6134188f8f7820f6ccdebd9f181
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 28 19:57:22 2015 +0100

    Add a hook to be called right after main.
    
    * common/init.c (early_system_init): New stub function.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index fe310f4..a874e76 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -665,6 +665,8 @@ main (int argc, char **argv )
   gpg_error_t err;
   struct assuan_malloc_hooks malloc_hooks;
 
+  early_system_init ();
+
   /* Before we do anything else we save the list of currently open
      file descriptors and the signal mask.  This info is required to
      do the exec call properly. */
diff --git a/agent/preset-passphrase.c b/agent/preset-passphrase.c
index ad8e500..6378d7a 100644
--- a/agent/preset-passphrase.c
+++ b/agent/preset-passphrase.c
@@ -212,6 +212,7 @@ main (int argc, char **argv)
   int cmd = 0;
   const char *keygrip = NULL;
 
+  early_system_init ();
   set_strusage (my_strusage);
   log_set_prefix ("gpg-preset-passphrase", 1);
 
diff --git a/agent/protect-tool.c b/agent/protect-tool.c
index 5e540cf..dc363f2 100644
--- a/agent/protect-tool.c
+++ b/agent/protect-tool.c
@@ -549,6 +549,7 @@ main (int argc, char **argv )
   int cmd = 0;
   const char *fname;
 
+  early_system_init ();
   set_strusage (my_strusage);
   gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
   log_set_prefix ("gpg-protect-tool", 1);
diff --git a/common/init.c b/common/init.c
index 2d5d630..c68a4e6 100644
--- a/common/init.c
+++ b/common/init.c
@@ -133,6 +133,13 @@ writestring_via_estream (int mode, const char *string)
 }
 
 
+/* This function should be the first called after main.  */
+void
+early_system_init (void)
+{
+}
+
+
 /* This function is to be used early at program startup to make sure
    that some subsystems are initialized.  This is in particular
    important for W32 to initialize the sockets so that our socket
diff --git a/common/init.h b/common/init.h
index eea2eb1..530a479 100644
--- a/common/init.h
+++ b/common/init.h
@@ -38,6 +38,7 @@
 
 void register_mem_cleanup_func (void (*func)(void));
 
+void early_system_init (void);
 void _init_common_subsystems (gpg_err_source_t errsource,
                               int *argcp, char ***argvp);
 #define init_common_subsystems(a,b)                             \
diff --git a/dirmngr/dirmngr-client.c b/dirmngr/dirmngr-client.c
index 0e62764..770e941 100644
--- a/dirmngr/dirmngr-client.c
+++ b/dirmngr/dirmngr-client.c
@@ -40,6 +40,7 @@
 
 #include "i18n.h"
 #include "util.h"
+#include "init.h"
 
 
 /* Constants for the options.  */
@@ -180,6 +181,7 @@ main (int argc, char **argv )
   int cmd_loadcrl = 0;
   int cmd_squid_mode = 0;
 
+  early_system_init ();
   set_strusage (my_strusage);
   log_set_prefix ("dirmngr-client",
                   JNLIB_LOG_WITH_PREFIX);
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index d3424c1..a46f736 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -650,6 +650,8 @@ main (int argc, char **argv)
   int homedir_seen = 0;
   struct assuan_malloc_hooks malloc_hooks;
 
+  early_system_init ();
+
 #ifdef USE_W32_SERVICE
   /* The option will be set by main() below if we should run as a
      system daemon.  */
diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c
index daa2d1b..981b5cc 100644
--- a/dirmngr/dirmngr_ldap.c
+++ b/dirmngr/dirmngr_ldap.c
@@ -242,6 +242,8 @@ ldap_wrapper_main (char **argv, estream_t outstream)
 
   memset (&my_opt_buffer, 0, sizeof my_opt_buffer);
 
+  early_system_init ();
+
 #ifdef USE_LDAPWRAPPER
   set_strusage (my_strusage);
   log_set_prefix ("dirmngr_ldap", JNLIB_LOG_WITH_PREFIX);
diff --git a/g10/gpg.c b/g10/gpg.c
index 2047e30..5e929d9 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -2048,6 +2048,7 @@ main (int argc, char **argv)
     /* Please note that we may running SUID(ROOT), so be very CAREFUL
        when adding any stuff between here and the call to
        secmem_init() somewhere after the option parsing. */
+    early_system_init ();
     gnupg_reopen_std (GPG_NAME);
     trap_unaligned ();
     gnupg_rl_initialize ();
diff --git a/g10/gpgv.c b/g10/gpgv.c
index f09b5da..157fdea 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -144,6 +144,7 @@ main( int argc, char **argv )
   unsigned configlineno;
   ctrl_t ctrl;
 
+  early_system_init ();
   set_strusage (my_strusage);
   log_set_prefix ("gpgv", 1);
 
diff --git a/g13/g13.c b/g13/g13.c
index 8682114..157e646 100644
--- a/g13/g13.c
+++ b/g13/g13.c
@@ -344,6 +344,7 @@ main ( int argc, char **argv)
 
   /*mtrace();*/
 
+  early_system_init ();
   gnupg_reopen_std (G13_NAME);
   set_strusage (my_strusage);
   gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
diff --git a/kbx/kbxutil.c b/kbx/kbxutil.c
index 34cbc53..368c02d 100644
--- a/kbx/kbxutil.c
+++ b/kbx/kbxutil.c
@@ -452,6 +452,7 @@ main( int argc, char **argv )
   unsigned long from = 0, to = ULONG_MAX;
   int dry_run = 0;
 
+  early_system_init ();
   set_strusage( my_strusage );
   gcry_control (GCRYCTL_DISABLE_SECMEM);
   log_set_prefix ("kbxutil", 1);
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 7c786c2..d0777e8 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -411,6 +411,7 @@ main (int argc, char **argv )
   int res;
   npth_t pipecon_handler;
 
+  early_system_init ();
   set_strusage (my_strusage);
   gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
   /* Please note that we may running SUID(ROOT), so be very CAREFUL
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 72bceb4..62e29b8 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -910,6 +910,7 @@ main ( int argc, char **argv)
 
   /*mtrace();*/
 
+  early_system_init ();
   gnupg_reopen_std (GPGSM_NAME);
   /* trap_unaligned ();*/
   gnupg_rl_initialize ();
diff --git a/tools/gpg-check-pattern.c b/tools/gpg-check-pattern.c
index 2db9ae5..e76f121 100644
--- a/tools/gpg-check-pattern.c
+++ b/tools/gpg-check-pattern.c
@@ -164,6 +164,7 @@ main (int argc, char **argv )
   size_t raw_pattern_length;
   pattern_t *patternarray;
 
+  early_system_init ();
   set_strusage (my_strusage);
   gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
   log_set_prefix ("gpg-check-pattern", 1);
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 1d9bb66..f1d123f 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -1169,6 +1169,7 @@ main (int argc, char **argv)
   int        loopidx;
   char **cmdline_commands = NULL;
 
+  early_system_init ();
   gnupg_rl_initialize ();
   set_strusage (my_strusage);
   log_set_prefix ("gpg-connect-agent", 1);
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index 423a66c..180c88a 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -151,6 +151,7 @@ main (int argc, char **argv)
   enum cmd_and_opt_values cmd = 0;
   estream_t outfp = NULL;
 
+  early_system_init ();
   gnupg_reopen_std (GPGCONF_NAME);
   set_strusage (my_strusage);
   log_set_prefix (GPGCONF_NAME, 1);
diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c
index 4873d76..c7fc5b6 100644
--- a/tools/symcryptrun.c
+++ b/tools/symcryptrun.c
@@ -889,6 +889,7 @@ main (int argc, char **argv)
   char *logfile = NULL;
   int default_config = 1;
 
+  early_system_init ();
   set_strusage (my_strusage);
   log_set_prefix ("symcryptrun", 1);
 

-----------------------------------------------------------------------

Summary of changes:
 agent/gpg-agent.c         |   2 +
 agent/preset-passphrase.c |   1 +
 agent/protect-tool.c      |   1 +
 common/init.c             |   7 +++
 common/init.h             |   1 +
 common/stringhelp.c       | 123 -----------------------------------------
 common/stringhelp.h       |  10 ----
 dirmngr/dirmngr-client.c  |   2 +
 dirmngr/dirmngr.c         |   2 +
 dirmngr/dirmngr_ldap.c    |   2 +
 g10/gpg.c                 |   4 +-
 g10/gpgv.c                |   1 +
 g10/parse-packet.c        |  22 +++++++-
 g13/g13.c                 |   1 +
 kbx/kbxutil.c             |   1 +
 scd/scdaemon.c            |   1 +
 sm/certdump.c             | 137 ++++------------------------------------------
 sm/gpgsm.c                |   1 +
 tools/gpg-check-pattern.c |   1 +
 tools/gpg-connect-agent.c |   1 +
 tools/gpgconf.c           |   1 +
 tools/symcryptrun.c       |   1 +
 22 files changed, 61 insertions(+), 262 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list