summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-09-26 14:38:11 +0200
committerWerner Koch <wk@gnupg.org>2022-09-26 14:41:04 +0200
commitacabbc0078d809d8f636c59dcb8735ab55ddecf9 (patch)
treea932ad15787f3dba398815812ea10268acad6d11
parentgpg: Don't consider unknown keys as non-compliant while decrypting. (diff)
downloadgnupg2-acabbc0078d809d8f636c59dcb8735ab55ddecf9.tar.xz
gnupg2-acabbc0078d809d8f636c59dcb8735ab55ddecf9.zip
dirmngr: Support gpgMailbox for mode MAILSUB and MAILEND.
* dirmngr/ks-engine-ldap.c (keyspec_to_ldap_filter): Use gpgMailbox if server supports this.
-rw-r--r--dirmngr/ks-engine-ldap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dirmngr/ks-engine-ldap.c b/dirmngr/ks-engine-ldap.c
index e5d0a28f4..b3f7f8ff5 100644
--- a/dirmngr/ks-engine-ldap.c
+++ b/dirmngr/ks-engine-ldap.c
@@ -223,13 +223,19 @@ keyspec_to_ldap_filter (const char *keyspec, char **filter, int only_exact,
break;
case KEYDB_SEARCH_MODE_MAILSUB:
- if (! only_exact)
+ if ((serverinfo & SERVERINFO_SCHEMAV2))
+ f = xasprintf("(&(gpgMailbox=*%s*)(!(|(pgpRevoked=1)(pgpDisabled=1))))",
+ (freeme = ldap_escape_filter (desc.u.name)));
+ else if (!only_exact)
f = xasprintf ("(pgpUserID=*<*%s*>*)",
(freeme = ldap_escape_filter (desc.u.name)));
break;
case KEYDB_SEARCH_MODE_MAILEND:
- if (! only_exact)
+ if ((serverinfo & SERVERINFO_SCHEMAV2))
+ f = xasprintf("(&(gpgMailbox=*%s)(!(|(pgpRevoked=1)(pgpDisabled=1))))",
+ (freeme = ldap_escape_filter (desc.u.name)));
+ else if (!only_exact)
f = xasprintf ("(pgpUserID=*<*%s>*)",
(freeme = ldap_escape_filter (desc.u.name)));
break;