[svn] GnuPG - r3981 - trunk/util

svn author dshaw cvs at cvs.gnupg.org
Sat Dec 24 16:35:44 CET 2005


Author: dshaw
Date: 2005-12-24 16:35:39 +0100 (Sat, 24 Dec 2005)
New Revision: 3981

Modified:
   trunk/util/ChangeLog
   trunk/util/cert.c
Log:
* cert.c (get_cert): Properly chase down CNAMEs pointing to CERTs.


Modified: trunk/util/ChangeLog
===================================================================
--- trunk/util/ChangeLog	2005-12-23 22:17:11 UTC (rev 3980)
+++ trunk/util/ChangeLog	2005-12-24 15:35:39 UTC (rev 3981)
@@ -1,3 +1,7 @@
+2005-12-24  David Shaw  <dshaw at jabberwocky.com>
+
+	* cert.c (get_cert): Properly chase down CNAMEs pointing to CERTs.
+
 2005-12-23  David Shaw  <dshaw at jabberwocky.com>
 
 	* cert.c, Makefile.am: New code to do DNS CERT queries.

Modified: trunk/util/cert.c
===================================================================
--- trunk/util/cert.c	2005-12-23 22:17:11 UTC (rev 3980)
+++ trunk/util/cert.c	2005-12-24 15:35:39 UTC (rev 3981)
@@ -96,9 +96,6 @@
 
 	  type=*pt++ << 8;
 	  type|=*pt++;
-	  /* We asked for CERT and got something else !? */
-	  if(type!=T_CERT)
-	    break;
 
 	  class=*pt++ << 8;
 	  class|=*pt++;
@@ -113,6 +110,14 @@
 	  dlen=*pt++ << 8;
 	  dlen|=*pt++;
 
+	  /* We asked for CERT and got something else - might be a
+	     CNAME, so loop around again. */
+	  if(type!=T_CERT)
+	    {
+	      pt+=dlen;
+	      continue;
+	    }
+
 	  /* The CERT type */
 	  ctype=*pt++ << 8;
 	  ctype|=*pt++;
@@ -125,7 +130,7 @@
 	  if(ctype==3 && iobuf)
 	    {
 	      /* PGP type */
-	      *iobuf=iobuf_temp_with_content(pt,dlen);
+	      *iobuf=iobuf_temp_with_content((char *)pt,dlen);
 	      ret=1;
 	      break;
 	    }
@@ -136,6 +141,7 @@
 
 	      *url=xmalloc(dlen+1);
 	      memcpy(*url,pt,dlen);
+	      (*url)[dlen]='\0';
 	      ret=2;
 	      break;
 	    }




More information about the Gnupg-commits mailing list