[git] GnuPG - branch, master, updated. gnupg-2.1.9-11-gc2c4007

by Werner Koch cvs at cvs.gnupg.org
Sun Oct 18 20:22:21 CEST 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  c2c400714854d5a127a6966200d345d0d6cfc7d4 (commit)
       via  558bcd43ae0a841cf1e58e06f5d72a19d5bc70cd (commit)
       via  e64c805b0c270d859ddf2c35d573110cf25e8d48 (commit)
       via  5aa1b392b1bf6fcf4cd380862c5affac39a4f34d (commit)
      from  128a456e775edf393d47e40bb9ae8b62434e2978 (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 c2c400714854d5a127a6966200d345d0d6cfc7d4
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Oct 18 20:17:24 2015 +0200

    gpg: Silence two more warnings.
    
    * g10/trustdb.c (tdb_get_validity_core): Silence a warning.
    * g10/tofu.c (tofu_register): Move SIG_DIGEST computation to the top
    so that it is not uninitialized in case of an early error.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/tofu.c b/g10/tofu.c
index 21a54bc..9b21d86 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -2096,6 +2096,8 @@ tofu_register (const byte *fingerprint_bin, const char *user_id,
   unsigned long c;
   int already_verified = 0;
 
+  sig_digest = make_radix64_string (sig_digest_bin, sig_digest_bin_len);
+
   dbs = opendbs ();
   if (! dbs)
     {
@@ -2128,8 +2130,6 @@ tofu_register (const byte *fingerprint_bin, const char *user_id,
     }
 
   /* Save the observed signature in the DB.  */
-  sig_digest = make_radix64_string (sig_digest_bin, sig_digest_bin_len);
-
   db = getdb (dbs, email, DB_EMAIL);
   if (! db)
     {
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 170c041..f58051a 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1003,7 +1003,7 @@ tdb_get_validity_core (PKT_public_key *pk, PKT_user_id *uid,
 
   if (opt.trust_model == TM_TOFU || opt.trust_model == TM_TOFU_PGP)
     {
-      kbnode_t user_id_node;
+      kbnode_t user_id_node = NULL; /* Silence -Wmaybe-uninitialized.  */
       int user_ids = 0;
       int user_ids_expired = 0;
 

commit 558bcd43ae0a841cf1e58e06f5d72a19d5bc70cd
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Oct 18 20:07:26 2015 +0200

    gpg: Fix harmless compiler warnings.
    
    * g10/tofu.h (_tofu_GET_POLICY_ERROR): New.  This avoids warnings
    about undefined enum values in a switch.
    * g10/trustdb.h (_tofu_GET_TRUST_ERROR): New.
    * g10/tofu.c (TIME_AGO_FUTURE_IGNORE): Move to the top.
    (opendbs): Avoid compiler warning (use braces).
    (GET_POLICY_ERROR): Replace define by enum _tofu_GET_POLICY_ERROR.
    (get_policy): Remove assert.
    (GET_TRUST_ERROR): Replace by _tofu_GET_TRUST_ERROR macro.
    (show_statistics): Undef MIN_SECS et al. after use.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/tofu.c b/g10/tofu.c
index b8705d7..21a54bc 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -82,6 +82,39 @@ struct db
   char name[1];
 };
 
+/* The grouping parameters when collecting signature statistics.  */
+
+/* If a message is signed a couple of hours in the future, just assume
+   some clock skew.  */
+#define TIME_AGO_FUTURE_IGNORE (2 * 60 * 60)
+#if 0
+#  define TIME_AGO_UNIT_SMALL 60
+#  define TIME_AGO_UNIT_SMALL_NAME _("minute")
+#  define TIME_AGO_UNIT_SMALL_NAME_PLURAL _("minutes")
+#  define TIME_AGO_MEDIUM_THRESHOLD (60 * TIME_AGO_UNIT_SMALL)
+#  define TIME_AGO_UNIT_MEDIUM (60 * 60)
+#  define TIME_AGO_UNIT_MEDIUM_NAME _("hour")
+#  define TIME_AGO_UNIT_MEDIUM_NAME_PLURAL _("hours")
+#  define TIME_AGO_LARGE_THRESHOLD (24 * 60 * TIME_AGO_UNIT_SMALL)
+#  define TIME_AGO_UNIT_LARGE (24 * 60 * 60)
+#  define TIME_AGO_UNIT_LARGE_NAME _("day")
+#  define TIME_AGO_UNIT_LARGE_NAME_PLURAL _("days")
+#else
+#  define TIME_AGO_UNIT_SMALL (24 * 60 * 60)
+#  define TIME_AGO_UNIT_SMALL_NAME _("day")
+#  define TIME_AGO_UNIT_SMALL_NAME_PLURAL _("days")
+#  define TIME_AGO_MEDIUM_THRESHOLD (4 * TIME_AGO_UNIT_SMALL)
+#  define TIME_AGO_UNIT_MEDIUM (7 * 24 * 60 * 60)
+#  define TIME_AGO_UNIT_MEDIUM_NAME _("week")
+#  define TIME_AGO_UNIT_MEDIUM_NAME_PLURAL _("weeks")
+#  define TIME_AGO_LARGE_THRESHOLD (28 * TIME_AGO_UNIT_SMALL)
+#  define TIME_AGO_UNIT_LARGE (30 * 24 * 60 * 60)
+#  define TIME_AGO_UNIT_LARGE_NAME _("month")
+#  define TIME_AGO_UNIT_LARGE_NAME_PLURAL _("months")
+#endif
+
+
+
 const char *
 tofu_policy_str (enum tofu_policy policy)
 {
@@ -647,8 +680,9 @@ opendbs (void)
 	return NULL;
     }
   else
-    /* Create a dummy entry so that we have a handle.  */
-    ;
+    {
+      /* Create a dummy entry so that we have a handle.  */
+    }
 
   dbs = xmalloc_clear (sizeof (*dbs));
   dbs->db = db;
@@ -1058,37 +1092,6 @@ signature_stats_collect_cb (void *cookie, int argc, char **argv,
   return 0;
 }
 
-/* The grouping parameters when collecting signature statistics.  */
-
-/* If a message is signed a couple of hours in the future, just assume
-   some clock skew.  */
-#define TIME_AGO_FUTURE_IGNORE (2 * 60 * 60)
-#if 0
-#  define TIME_AGO_UNIT_SMALL 60
-#  define TIME_AGO_UNIT_SMALL_NAME _("minute")
-#  define TIME_AGO_UNIT_SMALL_NAME_PLURAL _("minutes")
-#  define TIME_AGO_MEDIUM_THRESHOLD (60 * TIME_AGO_UNIT_SMALL)
-#  define TIME_AGO_UNIT_MEDIUM (60 * 60)
-#  define TIME_AGO_UNIT_MEDIUM_NAME _("hour")
-#  define TIME_AGO_UNIT_MEDIUM_NAME_PLURAL _("hours")
-#  define TIME_AGO_LARGE_THRESHOLD (24 * 60 * TIME_AGO_UNIT_SMALL)
-#  define TIME_AGO_UNIT_LARGE (24 * 60 * 60)
-#  define TIME_AGO_UNIT_LARGE_NAME _("day")
-#  define TIME_AGO_UNIT_LARGE_NAME_PLURAL _("days")
-#else
-#  define TIME_AGO_UNIT_SMALL (24 * 60 * 60)
-#  define TIME_AGO_UNIT_SMALL_NAME _("day")
-#  define TIME_AGO_UNIT_SMALL_NAME_PLURAL _("days")
-#  define TIME_AGO_MEDIUM_THRESHOLD (4 * TIME_AGO_UNIT_SMALL)
-#  define TIME_AGO_UNIT_MEDIUM (7 * 24 * 60 * 60)
-#  define TIME_AGO_UNIT_MEDIUM_NAME _("week")
-#  define TIME_AGO_UNIT_MEDIUM_NAME_PLURAL _("weeks")
-#  define TIME_AGO_LARGE_THRESHOLD (28 * TIME_AGO_UNIT_SMALL)
-#  define TIME_AGO_UNIT_LARGE (30 * 24 * 60 * 60)
-#  define TIME_AGO_UNIT_LARGE_NAME _("month")
-#  define TIME_AGO_UNIT_LARGE_NAME_PLURAL _("months")
-#endif
-
 /* Convert from seconds to time units.
 
    Note: T should already be a multiple of TIME_AGO_UNIT_SMALL or
@@ -1128,11 +1131,9 @@ time_ago_unit (signed long t)
 }
 
 
-#define GET_POLICY_ERROR 100
-
 /* Return the policy for the binding <FINGERPRINT, EMAIL> (email has
    already been normalized) and any conflict information in *CONFLICT
-   if CONFLICT is not NULL.  Returns GET_POLICY_ERROR if an error
+   if CONFLICT is not NULL.  Returns _tofu_GET_POLICY_ERROR if an error
    occurs.  */
 static enum tofu_policy
 get_policy (struct db *dbs, const char *fingerprint, const char *email,
@@ -1143,18 +1144,11 @@ get_policy (struct db *dbs, const char *fingerprint, const char *email,
   char *err = NULL;
   strlist_t strlist = NULL;
   char *tail = NULL;
-  enum tofu_policy policy = GET_POLICY_ERROR;
-
-  assert (GET_POLICY_ERROR != TOFU_POLICY_NONE
-	  && GET_POLICY_ERROR != TOFU_POLICY_AUTO
-	  && GET_POLICY_ERROR != TOFU_POLICY_GOOD
-	  && GET_POLICY_ERROR != TOFU_POLICY_UNKNOWN
-	  && GET_POLICY_ERROR != TOFU_POLICY_BAD
-	  && GET_POLICY_ERROR != TOFU_POLICY_ASK);
+  enum tofu_policy policy = _tofu_GET_POLICY_ERROR;
 
   db = getdb (dbs, email, DB_EMAIL);
   if (! db)
-    return GET_POLICY_ERROR;
+    return _tofu_GET_POLICY_ERROR;
 
   /* Check if the <FINGERPRINT, EMAIL> binding is known
      (TOFU_POLICY_NONE cannot appear in the DB.  Thus, if POLICY is
@@ -1209,7 +1203,7 @@ get_policy (struct db *dbs, const char *fingerprint, const char *email,
     {
       log_error (_("TOFU DB is corrupted.  Invalid value for policy (%d).\n"),
 		 policy);
-      policy = GET_POLICY_ERROR;
+      policy = _tofu_GET_POLICY_ERROR;
       goto out;
     }
 
@@ -1226,7 +1220,7 @@ get_policy (struct db *dbs, const char *fingerprint, const char *email,
     }
 
  out:
-  assert (policy == GET_POLICY_ERROR
+  assert (policy == _tofu_GET_POLICY_ERROR
 	  || policy == TOFU_POLICY_NONE
 	  || policy == TOFU_POLICY_AUTO
 	  || policy == TOFU_POLICY_GOOD
@@ -1239,12 +1233,10 @@ get_policy (struct db *dbs, const char *fingerprint, const char *email,
   return policy;
 }
 
-#define GET_TRUST_ERROR 100
-
 /* Return the trust level (TRUST_NEVER, etc.) for the binding
    <FINGERPRINT, EMAIL> (email is already normalized).  If no policy
    is registered, returns TOFU_POLICY_NONE.  If an error occurs,
-   returns GET_TRUST_ERROR.
+   returns _tofu_GET_TRUST_ERROR.
 
    USER_ID is the unadultered user id.
 
@@ -1270,19 +1262,19 @@ get_trust (struct db *dbs, const char *fingerprint, const char *email,
   if (opt.batch)
     may_ask = 0;
 
-  /* Make sure GET_TRUST_ERROR isn't equal to any of the trust
+  /* Make sure _tofu_GET_TRUST_ERROR isn't equal to any of the trust
      levels.  */
-  assert (GET_TRUST_ERROR != TRUST_UNKNOWN
-	  && GET_TRUST_ERROR != TRUST_EXPIRED
-	  && GET_TRUST_ERROR != TRUST_UNDEFINED
-	  && GET_TRUST_ERROR != TRUST_NEVER
-	  && GET_TRUST_ERROR != TRUST_MARGINAL
-	  && GET_TRUST_ERROR != TRUST_FULLY
-	  && GET_TRUST_ERROR != TRUST_ULTIMATE);
+  assert (_tofu_GET_TRUST_ERROR != TRUST_UNKNOWN
+	  && _tofu_GET_TRUST_ERROR != TRUST_EXPIRED
+	  && _tofu_GET_TRUST_ERROR != TRUST_UNDEFINED
+	  && _tofu_GET_TRUST_ERROR != TRUST_NEVER
+	  && _tofu_GET_TRUST_ERROR != TRUST_MARGINAL
+	  && _tofu_GET_TRUST_ERROR != TRUST_FULLY
+	  && _tofu_GET_TRUST_ERROR != TRUST_ULTIMATE);
 
   db = getdb (dbs, email, DB_EMAIL);
   if (! db)
-    return GET_TRUST_ERROR;
+    return _tofu_GET_TRUST_ERROR;
 
   policy = get_policy (dbs, fingerprint, email, &conflict);
   if (policy == TOFU_POLICY_AUTO)
@@ -1322,8 +1314,8 @@ get_trust (struct db *dbs, const char *fingerprint, const char *email,
 	 below.  */
       break;
 
-    case GET_POLICY_ERROR:
-      trust_level = GET_TRUST_ERROR;
+    case _tofu_GET_POLICY_ERROR:
+      trust_level = _tofu_GET_TRUST_ERROR;
       goto out;
 
     default:
@@ -1388,7 +1380,7 @@ get_trust (struct db *dbs, const char *fingerprint, const char *email,
 	{
 	  log_error (_("error setting TOFU binding's trust level to %s\n"),
 		       "auto");
-	  trust_level = GET_TRUST_ERROR;
+	  trust_level = _tofu_GET_TRUST_ERROR;
 	  goto out;
 	}
 
@@ -1710,7 +1702,7 @@ get_trust (struct db *dbs, const char *fingerprint, const char *email,
 				    policy, 0) != 0)
 		  /* If there's an error registering the
 		     binding, don't save the signature.  */
-		  trust_level = GET_TRUST_ERROR;
+		  trust_level = _tofu_GET_TRUST_ERROR;
 
 		break;
 	      }
@@ -1894,6 +1886,12 @@ show_statistics (struct db *dbs, const char *fingerprint,
 		}
 	      seconds = first_seen_ago;
 
+#undef MIN_SECS
+#undef HOUR_SECS
+#undef DAY_SECS
+#undef MONTH_SECS
+#undef YEAR_SECS
+
 	      if (years)
 		{
 		  if (years > 1)
@@ -2122,7 +2120,7 @@ tofu_register (const byte *fingerprint_bin, const char *user_id,
   /* It's necessary to get the trust so that we are certain that the
      binding has been registered.  */
   trust_level = get_trust (dbs, fingerprint, email, user_id, may_ask);
-  if (trust_level == GET_TRUST_ERROR)
+  if (trust_level == _tofu_GET_TRUST_ERROR)
     /* An error.  */
     {
       trust_level = TRUST_UNKNOWN;
@@ -2327,7 +2325,7 @@ tofu_get_validity (const byte *fingerprint_bin, const char *user_id,
   email = email_from_user_id (user_id);
 
   trust_level = get_trust (dbs, fingerprint, email, user_id, may_ask);
-  if (trust_level == GET_TRUST_ERROR)
+  if (trust_level == _tofu_GET_TRUST_ERROR)
     /* An error.  */
     trust_level = TRUST_UNDEFINED;
 
@@ -2466,7 +2464,7 @@ tofu_get_policy (PKT_public_key *pk, PKT_user_id *user_id,
   xfree (fingerprint);
   closedbs (dbs);
 
-  if (*policy == GET_POLICY_ERROR)
+  if (*policy == _tofu_GET_POLICY_ERROR)
     return gpg_error (GPG_ERR_GENERAL);
   return 0;
 }
diff --git a/g10/tofu.h b/g10/tofu.h
index 7516684..b0fcc5b 100644
--- a/g10/tofu.h
+++ b/g10/tofu.h
@@ -56,7 +56,11 @@ enum tofu_policy
        binding (by selecting accept once or reject once).  The next
        time we see this binding, we should ask the user what to
        do.  */
-    TOFU_POLICY_ASK = 5
+    TOFU_POLICY_ASK = 5,
+
+
+    /* Privat evalue used only within tofu.c.  */
+    _tofu_GET_POLICY_ERROR = 100
   };
 
 /* Return a string representation of a trust policy.  Returns "???" if
diff --git a/g10/trustdb.h b/g10/trustdb.h
index 2c3f865..adb75d7 100644
--- a/g10/trustdb.h
+++ b/g10/trustdb.h
@@ -36,6 +36,11 @@
 #define TRUST_FLAG_DISABLED 128 /* d: key/uid disabled */
 #define TRUST_FLAG_PENDING_CHECK 256 /* a check-trustdb is pending */
 
+/* Private value used in tofu.c - must be different from the trust
+   values.  */
+#define _tofu_GET_TRUST_ERROR 100
+
+/* Length of the hash used to select UIDs in keyedit.c.  */
 #define NAMEHASH_LEN  20
 
 

commit e64c805b0c270d859ddf2c35d573110cf25e8d48
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Oct 18 19:37:41 2015 +0200

    common: Avoid warning about const char ** assignment.
    
    * common/mkdir_p.c (gnupg_amkdir_p): Also strdup first item.  Return
    an error on malloc failure.
    (gnupg_mkdir_p): Fix type of dirs and tmp_dirs.
    --
    
    The code was correct but it inhibits type checking.  Instead of
    casting it seems easier to simply allocate also the the first item in
    DIRS.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/mkdir_p.c b/common/mkdir_p.c
index 43f9e02..2e93d65 100644
--- a/common/mkdir_p.c
+++ b/common/mkdir_p.c
@@ -53,16 +53,21 @@ gnupg_amkdir_p (const char **directory_components)
 
   /* log_debug ("%s: %d directory components.\n", __func__, count); */
 
-  dirs = xtrycalloc (count, sizeof (char *));
+  dirs = xtrycalloc (count, sizeof *dirs);
   if (!dirs)
     return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
 
   for (i = 0; directory_components[i]; i ++)
     {
       if (i == 0)
-	dirs[i] = directory_components[i];
+	dirs[i] = xtrystrdup (directory_components[i]);
       else
-	dirs[i] = make_filename (dirs[i - 1], directory_components[i], NULL);
+	dirs[i] = make_filename_try (dirs[i-1], directory_components[i], NULL);
+      if (!dirs[i])
+        {
+          err = gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
+          goto out;
+        }
 
       /* log_debug ("%s: Directory %d: `%s'.\n", __func__, i, dirs[i]); */
     }
@@ -127,7 +132,7 @@ gnupg_amkdir_p (const char **directory_components)
     }
 
  out:
-  for (i = 1; i < count; i ++)
+  for (i = 0; i < count; i ++)
     xfree (dirs[i]);
   xfree (dirs);
 
@@ -144,7 +149,7 @@ gnupg_mkdir_p (const char *directory_component, ...)
   gpg_error_t err = 0;
   int i;
   int space = 1;
-  char **dirs;
+  const char **dirs;
 
   dirs = xtrymalloc (space * sizeof (char *));
   if (!dirs)
@@ -157,7 +162,7 @@ gnupg_mkdir_p (const char *directory_component, ...)
     {
       if (i == space)
 	{
-          char **tmp_dirs;
+          const char **tmp_dirs;
 
 	  space = 2 * space;
 	  tmp_dirs = xtryrealloc (dirs, space * sizeof (char *));

commit 5aa1b392b1bf6fcf4cd380862c5affac39a4f34d
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Oct 18 20:07:44 2015 +0200

    Move http module from common/ to dirmngr/.
    
    * common/http.c: Move to ../dirmngr/.
    * common/http.h: Move to ../dirmngr/.
    * common/t-http.c: Move to ../dirmngr/.
    * common/tls-ca.pem: Move to ../dirmngr/.
    * common/Makefile.am: Do not build libcommontls.a libcommontlsnpth.a.
    Remove http.c related stuff.
    * po/POTFILES.in: Move http.c to dirmngr/.
    * dirmngr/Makefile.am (EXTRA_DIST): Add tls-ca.pem.
    (module_maint_tests): New.
    (noinst_PROGRAMS): Add module_maint_tests.
    (dirmngr_SOURCES): Add http.c and http.h.
    (dirmngr_LDADD): Remove libcommontlsnpth.
    (t_common_ldadd): Ditto.
    (t_http_SOURCES, t_http_CFLAGS, t_http_LDADD): New.
    (t_ldap_parse_uri_SOURCES): Add http.c.
    (t_ldap_parse_uri_CFLAGS): Build without npth.
    ($(PROGRAMS)): Do not require libcommontls.a libcommontlsnpth.a.
    * dirmngr/dirmngr.h, dirmngr/ks-engine.h: Fix include of http.h.
    --
    
    All network access is done via dirmngr and thus http.c should be
    there.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/Makefile.am b/common/Makefile.am
index 7c87fa9..2be51f1 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -20,10 +20,9 @@
 
 EXTRA_DIST = mkstrtable.awk exaudit.awk exstatus.awk ChangeLog-2011 \
              audit-events.h status-codes.h ChangeLog.jnlib \
-	     ChangeLog-2011.include w32info-rc.h.in gnupg.ico tls-ca.pem
+	     ChangeLog-2011.include w32info-rc.h.in gnupg.ico
 
-noinst_LIBRARIES = libcommon.a libcommonpth.a libgpgrl.a \
-                   libcommontls.a libcommontlsnpth.a
+noinst_LIBRARIES = libcommon.a libcommonpth.a libgpgrl.a
 if !HAVE_W32CE_SYSTEM
 noinst_LIBRARIES += libsimple-pwquery.a
 endif
@@ -93,12 +92,6 @@ if HAVE_W32_SYSTEM
 common_sources += w32-reg.c w32-afunix.c w32-afunix.h
 endif
 
-# Sources possible requiring a TLS library are put into a separate
-# conveince library.
-tls_sources = \
-	http.c http.h
-
-
 # To make the code easier to read we have split home some code into
 # separate source files.
 if HAVE_W32_SYSTEM
@@ -128,12 +121,6 @@ libcommonpth_a_SOURCES += srv.c
 endif
 libcommonpth_a_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS) $(NPTH_CFLAGS)
 
-libcommontls_a_SOURCES = $(tls_sources)
-libcommontls_a_CFLAGS = $(AM_CFLAGS) $(LIBGNUTLS_CFLAGS) -DWITHOUT_NPTH=1
-
-libcommontlsnpth_a_SOURCES = $(tls_sources)
-libcommontlsnpth_a_CFLAGS = $(AM_CFLAGS) $(LIBGNUTLS_CFLAGS) $(NPTH_CFLAGS)
-
 if !HAVE_W32CE_SYSTEM
 libsimple_pwquery_a_SOURCES = \
 	simple-pwquery.c simple-pwquery.h asshelp.c asshelp.h
@@ -179,7 +166,7 @@ module_tests += t-w32-reg
 endif
 
 if MAINTAINER_MODE
-module_maint_tests = t-helpfile t-b64 t-http
+module_maint_tests = t-helpfile t-b64
 else
 module_maint_tests =
 endif
@@ -222,11 +209,5 @@ t_w32_reg_SOURCES = t-w32-reg.c $(t_extra_src)
 t_w32_reg_LDADD   = $(t_common_ldadd)
 endif
 
-# http tests
-t_http_SOURCES = t-http.c
-t_http_CFLAGS  = $(t_common_cflags) $(NTBTLS_CFLAGS) $(LIBGNUTLS_CFLAGS)
-t_http_LDADD   = libcommontls.a $(t_common_ldadd) \
-	         $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(DNSLIBS)
-
 # All programs should depend on the created libs.
-$(PROGRAMS) : libcommon.a libcommonpth.a libcommontls.a libcommontlsnpth.a
+$(PROGRAMS) : libcommon.a libcommonpth.a
diff --git a/dirmngr/Makefile.am b/dirmngr/Makefile.am
index cee777a..a9f09fd 100644
--- a/dirmngr/Makefile.am
+++ b/dirmngr/Makefile.am
@@ -19,7 +19,7 @@
 
 ## Process this file with automake to produce Makefile.in
 
-EXTRA_DIST = OAUTHORS ONEWS ChangeLog-2011
+EXTRA_DIST = OAUTHORS ONEWS ChangeLog-2011 tls-ca.pem
 
 bin_PROGRAMS = dirmngr dirmngr-client
 
@@ -27,7 +27,7 @@ if USE_LDAPWRAPPER
 libexec_PROGRAMS = dirmngr_ldap
 endif
 
-noinst_PROGRAMS = $(module_tests)
+noinst_PROGRAMS = $(module_tests) $(module_maint_tests)
 TESTS = $(module_tests)
 
 AM_CPPFLAGS = -I$(top_srcdir)/common
@@ -62,6 +62,7 @@ dirmngr_SOURCES = dirmngr.c dirmngr.h server.c crlcache.c crlfetch.c	\
 	cdb.h cdblib.c misc.c dirmngr-err.h  \
 	ocsp.c ocsp.h validate.c validate.h  \
 	dns-cert.c dns-cert.h \
+	http.c http.h \
 	ks-action.c ks-action.h ks-engine.h \
 	ks-engine-hkp.c ks-engine-http.c ks-engine-finger.c ks-engine-kdns.c
 
@@ -75,7 +76,7 @@ ldaplibs =
 endif
 
 
-dirmngr_LDADD = $(libcommontlsnpth) $(libcommonpth) \
+dirmngr_LDADD = $(libcommonpth) \
         $(DNSLIBS) $(LIBASSUAN_LIBS) \
 	$(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(NPTH_LIBS) \
 	$(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV)
@@ -108,8 +109,7 @@ no-libgcrypt.c : $(top_srcdir)/tools/no-libgcrypt.c
 
 
 t_common_src = t-support.h
-# We need libcommontls, because we use the http functions.
-t_common_ldadd = $(libcommontls) $(libcommon) no-libgcrypt.o \
+t_common_ldadd = $(libcommon) no-libgcrypt.o \
                  $(GPG_ERROR_LIBS) $(NETLIBS) \
                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) \
                  $(DNSLIBS) $(LIBINTL) $(LIBICONV)
@@ -120,12 +120,28 @@ if USE_LDAP
 module_tests += t-ldap-parse-uri
 endif
 
+if MAINTAINER_MODE
+module_maint_tests = t-http
+else
+module_maint_tests =
+endif
+
+
+# http tests
+t_http_SOURCES = t-http.c http.c
+t_http_CFLAGS  = -DWITHOUT_NPTH=1 \
+	         $(LIBGCRYPT_CFLAGS) $(NTBTLS_CFLAGS) $(LIBGNUTLS_CFLAGS) \
+                 $(GPG_ERROR_CFLAGS)
+t_http_LDADD   = $(t_common_ldadd) \
+	         $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(DNSLIBS)
+
 t_ldap_parse_uri_SOURCES = \
-	t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h \
+	t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h http.c \
         $(ldap_url) $(t_common_src)
+t_ldap_parse_uri_CFLAGS = -DWITHOUT_NPTH=1
 t_ldap_parse_uri_LDADD = $(ldaplibs) $(t_common_ldadd)
 
 t_dns_cert_SOURCES = t-dns-cert.c dns-cert.c
 t_dns_cert_LDADD   = $(t_common_ldadd)
 
-$(PROGRAMS) : $(libcommon) $(libcommonpth) $(libcommontls) $(libcommontlsnpth)
+$(PROGRAMS) : $(libcommon) $(libcommonpth)
diff --git a/dirmngr/dirmngr.h b/dirmngr/dirmngr.h
index b2b94f9..dff902a 100644
--- a/dirmngr/dirmngr.h
+++ b/dirmngr/dirmngr.h
@@ -33,7 +33,7 @@
 #include "../common/membuf.h"
 #include "../common/sysutils.h" /* (gnupg_fd_t) */
 #include "../common/i18n.h"
-#include "../common/http.h"     /* (parsed_uri_t) */
+#include "http.h"     /* (parsed_uri_t) */
 
 /* This objects keeps information about a particular LDAP server and
    is used as item of a single linked list of servers. */
diff --git a/common/http.c b/dirmngr/http.c
similarity index 100%
rename from common/http.c
rename to dirmngr/http.c
diff --git a/common/http.h b/dirmngr/http.h
similarity index 100%
rename from common/http.h
rename to dirmngr/http.h
diff --git a/dirmngr/ks-engine.h b/dirmngr/ks-engine.h
index aff6cf4..6684a12 100644
--- a/dirmngr/ks-engine.h
+++ b/dirmngr/ks-engine.h
@@ -21,7 +21,7 @@
 #ifndef DIRMNGR_KS_ENGINE_H
 #define DIRMNGR_KS_ENGINE_H 1
 
-#include "../common/http.h"
+#include "http.h"
 
 /*-- ks-action.c --*/
 gpg_error_t ks_print_help (ctrl_t ctrl, const char *text);
diff --git a/common/t-http.c b/dirmngr/t-http.c
similarity index 100%
rename from common/t-http.c
rename to dirmngr/t-http.c
diff --git a/common/tls-ca.pem b/dirmngr/tls-ca.pem
similarity index 100%
rename from common/tls-ca.pem
rename to dirmngr/tls-ca.pem
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 09c6ec4..dc88448 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -15,7 +15,6 @@ agent/cvt-openpgp.c
 common/exechelp-posix.c
 common/exechelp-w32.c
 common/exechelp-w32ce.c
-common/http.c
 common/simple-pwquery.c
 common/sysutils.c
 common/yesno.c
@@ -110,6 +109,7 @@ dirmngr/crlfetch.c
 dirmngr/dirmngr-client.c
 dirmngr/dirmngr.c
 dirmngr/dirmngr_ldap.c
+dirmngr/http.c
 dirmngr/ldap-wrapper-ce.c
 dirmngr/ldap-wrapper.c
 dirmngr/ldap.c

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

Summary of changes:
 common/Makefile.am             |  27 ++-------
 common/mkdir_p.c               |  17 ++++--
 dirmngr/Makefile.am            |  30 ++++++---
 dirmngr/dirmngr.h              |   2 +-
 {common => dirmngr}/http.c     |   0
 {common => dirmngr}/http.h     |   0
 dirmngr/ks-engine.h            |   2 +-
 {common => dirmngr}/t-http.c   |   0
 {common => dirmngr}/tls-ca.pem |   0
 g10/tofu.c                     | 134 ++++++++++++++++++++---------------------
 g10/tofu.h                     |   6 +-
 g10/trustdb.c                  |   2 +-
 g10/trustdb.h                  |   5 ++
 po/POTFILES.in                 |   2 +-
 14 files changed, 118 insertions(+), 109 deletions(-)
 rename {common => dirmngr}/http.c (100%)
 rename {common => dirmngr}/http.h (100%)
 rename {common => dirmngr}/t-http.c (100%)
 rename {common => dirmngr}/tls-ca.pem (100%)


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




More information about the Gnupg-commits mailing list