[svn] GnuPG - r4010 - trunk/g10

svn author dshaw cvs at cvs.gnupg.org
Tue Feb 21 17:09:13 CET 2006


Author: dshaw
Date: 2006-02-21 17:09:09 +0100 (Tue, 21 Feb 2006)
New Revision: 4010

Modified:
   trunk/g10/ChangeLog
   trunk/g10/gpgv.c
   trunk/g10/keyserver-internal.h
   trunk/g10/keyserver.c
Log:
* gpgv.c: Stub keyserver_import_ldap.

* keyserver-internal.h, keyserver.c (keyserver_import_ldap): Import using
the PGP Universal trick of asking ldap://keys.(maildomain) for the key.


Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2006-02-21 05:20:08 UTC (rev 4009)
+++ trunk/g10/ChangeLog	2006-02-21 16:09:09 UTC (rev 4010)
@@ -1,3 +1,11 @@
+2006-02-21  David Shaw  <dshaw at jabberwocky.com>
+
+	* gpgv.c: Stub keyserver_import_ldap.
+
+	* keyserver-internal.h, keyserver.c (keyserver_import_ldap):
+	Import using the PGP Universal trick of asking
+	ldap://keys.(maildomain) for the key.
+
 2006-02-20  David Shaw  <dshaw at jabberwocky.com>
 
 	* keyserver.c (parse_keyserver_uri): Include the scheme in the uri

Modified: trunk/g10/gpgv.c
===================================================================
--- trunk/g10/gpgv.c	2006-02-21 05:20:08 UTC (rev 4009)
+++ trunk/g10/gpgv.c	2006-02-21 16:09:09 UTC (rev 4010)
@@ -289,6 +289,9 @@
 int
 keyserver_import_name(const char *name) { return -1; }
 
+int
+keyserver_import_ldap(const char *name) { return -1; }
+
 /* Stub:
  * No encryption here but mainproc links to these functions.
  */

Modified: trunk/g10/keyserver-internal.h
===================================================================
--- trunk/g10/keyserver-internal.h	2006-02-21 05:20:08 UTC (rev 4009)
+++ trunk/g10/keyserver-internal.h	2006-02-21 16:09:09 UTC (rev 4010)
@@ -44,5 +44,6 @@
 int keyserver_import_cert(const char *name);
 int keyserver_import_pka(const char *name);
 int keyserver_import_name(const char *name);
+int keyserver_import_ldap(const char *name);
 
 #endif /* !_KEYSERVER_INTERNAL_H_ */

Modified: trunk/g10/keyserver.c
===================================================================
--- trunk/g10/keyserver.c	2006-02-21 05:20:08 UTC (rev 4009)
+++ trunk/g10/keyserver.c	2006-02-21 16:09:09 UTC (rev 4010)
@@ -2016,3 +2016,38 @@
 
   return rc;
 }
+
+/* Use the PGP Universal trick of asking ldap://keys.(maildomain) for
+   the key. */
+int
+keyserver_import_ldap(const char *name)
+{
+  char *domain;
+  struct keyserver_spec *keyserver;
+  STRLIST list=NULL;
+  int rc;
+
+  append_to_strlist(&list,name);
+
+  /* Parse out the domain */
+  domain=strrchr(name,'@');
+  if(!domain)
+    return G10ERR_GENERAL;
+
+  domain++;
+
+  keyserver=xmalloc_clear(sizeof(struct keyserver_spec));
+
+  keyserver->scheme=xstrdup("ldap");
+  keyserver->host=xmalloc(5+strlen(domain)+1);
+  strcpy(keyserver->host,"keys.");
+  strcat(keyserver->host,domain);
+    
+  rc=keyserver_work(KS_GETNAME,list,NULL,0,keyserver);
+
+  free_strlist(list);
+
+  free_keyserver_spec(keyserver);
+
+  return rc;
+}




More information about the Gnupg-commits mailing list