mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01: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:
parent
8a1bd087fc
commit
0eb4e93bd4
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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_ */
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user