[svn] dirmngr - r221 - in trunk: . src

svn author wk cvs at cvs.gnupg.org
Mon May 15 22:34:30 CEST 2006


Author: wk
Date: 2006-05-15 22:34:28 +0200 (Mon, 15 May 2006)
New Revision: 221

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/THANKS
   trunk/configure.ac
   trunk/src/ChangeLog
   trunk/src/crlcache.c
   trunk/src/crlfetch.c
   trunk/src/http.c
   trunk/src/http.h
Log:
Should close bug #516.

* crlfetch.c (crl_fetch): Use no-shutdown flag for HTTP.  This
seems to be required for "IBM_HTTP_Server/2.0.47.1 Apache/2.0.47
(Unix)".

* http.c (parse_tuple): Set flag to to indicate no value.
(build_rel_path): Take care of it.

* crlcache.c (crl_cache_reload_crl): Also iterate over all names
within a DP.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/ChangeLog	2006-05-15 20:34:28 UTC (rev 221)
@@ -1,3 +1,7 @@
+2006-05-15  Werner Koch  <wk at g10code.com>
+
+	* configure.ac: Use -Wno-pointer-sign if available.
+
 2005-10-26  Werner Koch  <wk at g10code.com>
 
 	Released 0.9.3.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/NEWS	2006-05-15 20:34:28 UTC (rev 221)
@@ -1,8 +1,11 @@
 Noteworthy changes in version 0.9.4
 ------------------------------------------------
 
+ * Try all names of each crlDP.
 
+ * Don't shutdown tthe socket after sending the HTTP request.
 
+
 Noteworthy changes in version 0.9.3 (2005-10-26)
 ------------------------------------------------
 

Modified: trunk/THANKS
===================================================================
--- trunk/THANKS	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/THANKS	2006-05-15 20:34:28 UTC (rev 221)
@@ -2,5 +2,7 @@
 Marcus Brinkmann    marcus at g10code.de
 Michael Nottebrock  michaelnottebrock at gmx.net
 Neil Dunbar         neil.dunbar at hp.com
+Peter Eisentraut    peter_e at gmx.net
 
+
 The whole Ägypten project team.

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/configure.ac	2006-05-15 20:34:28 UTC (rev 221)
@@ -101,6 +101,16 @@
     else
         CFLAGS="$CFLAGS -Wall"
     fi
+
+    AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
+    _gcc_cflags_save=$CFLAGS
+    CFLAGS="-Wno-pointer-sign"
+    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
+    AC_MSG_RESULT($_gcc_psign)
+    CFLAGS=$_gcc_cflags_save;
+    if test x"$_gcc_psign" = xyes ; then
+       CFLAGS="$CFLAGS -Wno-pointer-sign"
+    fi
 fi
 
 

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/src/ChangeLog	2006-05-15 20:34:28 UTC (rev 221)
@@ -1,3 +1,15 @@
+2006-05-15  Werner Koch  <wk at g10code.com>
+
+	* crlfetch.c (crl_fetch): Use no-shutdown flag for HTTP.  This
+	seems to be required for "IBM_HTTP_Server/2.0.47.1 Apache/2.0.47
+	(Unix)".
+
+	* http.c (parse_tuple): Set flag to to indicate no value.
+	(build_rel_path): Take care of it.
+
+	* crlcache.c (crl_cache_reload_crl): Also iterate over all names
+	within a DP.
+
 2005-09-28  Marcus Brinkmann  <marcus at g10code.de>
 
 	* Makefile.am (dirmngr_LDADD): Add @LIBINTL@ and @LIBICONV at .

Modified: trunk/src/crlcache.c
===================================================================
--- trunk/src/crlcache.c	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/src/crlcache.c	2006-05-15 20:34:28 UTC (rev 221)
@@ -2269,6 +2269,9 @@
                                                 &distpoint,
                                                 &issuername, NULL )))
     {
+      int name_seq; 
+      gpg_error_t last_err = 0;
+
       if (!distpoint && !issuername)
         {
           if (DBG_X509)
@@ -2278,52 +2281,71 @@
                     suitable CRL. */
         }
 
-      /* Get the URIs. */
-      xfree (distpoint_uri); distpoint_uri = NULL;
       xfree (issuername_uri); issuername_uri = NULL;
-      distpoint_uri = ksba_name_get_uri (distpoint, 0); 
-      issuername_uri = ksba_name_get_uri (issuername, 0); 
-      ksba_name_release (distpoint); distpoint = NULL;
-      ksba_name_release (issuername); issuername = NULL;
 
-      if (!distpoint_uri)
-        continue;
-
-      if (!strncmp (distpoint_uri, "ldap:", 5)
-          || !strncmp (distpoint_uri, "ldaps:", 6))
+      /* Get the URIs.  We do this in a loop to iterate over all names
+         in the crlDP. */
+      for (name_seq=0; ksba_name_enum (distpoint, name_seq); name_seq++)
         {
-          if (opt.ignore_ldap_dp)
+          xfree (distpoint_uri); distpoint_uri = NULL;
+          distpoint_uri = ksba_name_get_uri (distpoint, name_seq);
+          if (!distpoint_uri)
             continue;
+          
+          if (!strncmp (distpoint_uri, "ldap:", 5)
+              || !strncmp (distpoint_uri, "ldaps:", 6))
+            {
+              if (opt.ignore_ldap_dp)
+                continue;
+            }
+          else if (!strncmp (distpoint_uri, "http:", 5)
+                   || !strncmp (distpoint_uri, "https:", 6))
+            {
+              if (opt.ignore_http_dp)
+                continue;
+            }
+          else
+            continue; /* Skip unknown schemes. */
+          
+          any_dist_point = 1;
+          
+          if (DBG_X509)
+            log_debug ("fetching CRL from `%s'\n", distpoint_uri);
+          err = crl_fetch (ctrl, distpoint_uri, &reader);
+          if (err)
+            {
+              log_error (_("crl_fetch via DP failed: %s\n"),
+                         gpg_strerror (err));
+              last_err = err;
+              continue; /* with the next name. */
+            }
+          
+          if (DBG_X509)
+            log_debug ("inserting CRL\n");
+          err = crl_cache_insert (ctrl, distpoint_uri, reader); 
+          if (err)
+            {
+              log_error (_("crl_cache_insert via DP failed: %s\n"),
+                         gpg_strerror (err));
+              last_err = err;
+              continue; /* with the next name. */
+            }
+          last_err = 0;
+          break; /* Ready. */
         }
-      else if (!strncmp (distpoint_uri, "http:", 5)
-               || !strncmp (distpoint_uri, "https:", 6))
+      if (last_err)
         {
-          if (opt.ignore_http_dp)
-            continue;
-        }
-      else
-        continue; /* Skip unknown schemes. */
-
-      any_dist_point = 1;
-      
-      if (DBG_X509)
-        log_debug ("fetching CRL from `%s'\n", distpoint_uri);
-      err = crl_fetch (ctrl, distpoint_uri, &reader);
-      if (err)
-        {
-          log_error (_("crl_fetch via DP failed: %s\n"), gpg_strerror (err));
+          err = last_err;
           goto leave;
         }
       
-      if (DBG_X509)
-        log_debug ("inserting CRL\n");
-      err = crl_cache_insert (ctrl, distpoint_uri, reader); 
-      if (err)
-        {
-          log_error (_("crl_cache_insert via DP failed: %s\n"),
-                     gpg_strerror (err));
-          goto leave;
-        }
+      ksba_name_release (distpoint); distpoint = NULL;
+
+      /* We don't do anything with issuername_uri yet but we keep the
+         code for documentation. */
+      issuername_uri =  ksba_name_get_uri (issuername, 0); 
+      ksba_name_release (issuername); issuername = NULL;
+
     }
   if (gpg_err_code (err) == GPG_ERR_EOF)
     err = 0;

Modified: trunk/src/crlfetch.c
===================================================================
--- trunk/src/crlfetch.c	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/src/crlfetch.c	2006-05-15 20:34:28 UTC (rev 221)
@@ -75,7 +75,8 @@
         }
       else
         err = http_open_document (&hd, url,
-                                  opt.honor_http_proxy? HTTP_FLAG_TRY_PROXY:0,
+                                  (opt.honor_http_proxy? HTTP_FLAG_TRY_PROXY:0)
+                                  |HTTP_FLAG_NO_SHUTDOWN,
                                   opt.http_proxy);
 
       if (err)

Modified: trunk/src/http.c
===================================================================
--- trunk/src/http.c	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/src/http.c	2006-05-15 20:34:28 UTC (rev 221)
@@ -132,7 +132,7 @@
 
   http_start_data (hd);  /* Make sure that we are in the data. */
 
-  /* We dup the socket, to cope with thenfact that fclose closes the
+  /* We dup the socket, to cope with the fact that fclose closes the
      underlying socket. */
   hd->sock = dup (hd->sock); 
   if (hd->sock == -1)
@@ -428,6 +428,7 @@
     {
       tuple->value = p + strlen (p);
       tuple->valuelen = 0;
+      tuple->no_value = 1; /* Explicitly mark that we have seen no '='. */
     }
   else /* name and value */
     {
@@ -547,8 +548,11 @@
     {
       n++;                      /* '?'/'&' */
       n += insert_escapes (NULL, r->name, "%;?&=");
-      n++;                      /* '=' */
-      n += insert_escapes (NULL, r->value, "%;?&=");
+      if (!r->no_value)
+        {
+          n++;                      /* '=' */
+          n += insert_escapes (NULL, r->value, "%;?&=");
+        }
     }
   n++;
 
@@ -564,10 +568,13 @@
       *p++ = r == uri->query ? '?' : '&';
       n = insert_escapes (p, r->name, "%;?&=");
       p += n;
-      *p++ = '=';
-      /* TODO: Use valuelen. */
-      n = insert_escapes (p, r->value, "%;?&=");
-      p += n;
+      if (!r->no_value)
+        {
+          *p++ = '=';
+          /* TODO: Use valuelen. */
+          n = insert_escapes (p, r->value, "%;?&=");
+          p += n;
+        }
     }
   *p = 0;
   return rel_path;
@@ -974,22 +981,30 @@
   printf ("Path  : %s\n", uri->path);
   for (r = uri->params; r; r = r->next)
     {
-      printf ("Params: %s=%s", r->name, r->value);
-      if (strlen (r->value) != r->valuelen)
-        printf (" [real length=%d]", (int) r->valuelen);
+      printf ("Params: %s", r->name);
+      if (!r->no_value)
+        {
+          printf ("=%s", r->value);
+          if (strlen (r->value) != r->valuelen)
+            printf (" [real length=%d]", (int) r->valuelen);
+        }
       putchar ('\n');
     }
   for (r = uri->query; r; r = r->next)
     {
-      printf ("Query : %s=%s", r->name, r->value);
-      if (strlen (r->value) != r->valuelen)
-        printf (" [real length=%d]", (int) r->valuelen);
+      printf ("Query : %s", r->name);
+      if (!r->no_value)
+        {
+          printf ("=%s", r->value);
+          if (strlen (r->value) != r->valuelen)
+            printf (" [real length=%d]", (int) r->valuelen);
+        }
       putchar ('\n');
     }
   http_release_parsed_uri (uri);
   uri = NULL;
 
-  rc = http_open_document (&hd, *argv, 0);
+  rc = http_open_document (&hd, *argv, HTTP_FLAG_NO_SHUTDOWN, NULL);
   if (rc)
     {
       log_error ("can't get `%s': %s\n", *argv, gpg_strerror (rc));

Modified: trunk/src/http.h
===================================================================
--- trunk/src/http.h	2005-11-02 08:05:21 UTC (rev 220)
+++ trunk/src/http.h	2006-05-15 20:34:28 UTC (rev 221)
@@ -26,6 +26,7 @@
   char  *value;         /* A pointer to value (a Nul is always appended). */
   size_t valuelen;	/* The real length of the value; we need it
 			   because the value may contain embedded Nuls */
+  int no_value;         /* True if no value has been given inthe URL */
 };
 typedef struct uri_tuple_s *uri_tuple_t;
 




More information about the Gnupg-commits mailing list