1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-13 00:09:51 +02:00

* 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.
This commit is contained in:
David Shaw 2006-02-21 16:09:09 +00:00
parent 8a1bd087fc
commit 0eb4e93bd4
4 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2006-02-21 David Shaw <dshaw@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@jabberwocky.com>
* keyserver.c (parse_keyserver_uri): Include the scheme in the uri

View File

@ -289,6 +289,9 @@ keyserver_import_pka(const char *name) { return -1; }
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.
*/

View File

@ -44,5 +44,6 @@ int keyserver_fetch(STRLIST urilist);
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_ */

View File

@ -2016,3 +2016,38 @@ keyserver_import_name(const char *name)
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;
}