An LDAP server may have more up-to-date information (especially certifications) about a public key than the user. Therefore, the certificate should first be read automatically, which may supplement the information in the local keyring, before it is sent to the directory server.
Has to be tested with Kleopatra, too.
Description
Description
Revisions and Commits
Revisions and Commits
| rG GnuPG | |||
| rG329fa95150c7 gpg: Try to retrieve a key from LDAP before sending it. | |||
| rG242ced25509f gpg: Try to retrieve a key from LDAP before sending it. | |||
Related Objects
Related Objects
- Mentioned In
- T7756: Release GnuPG 2.5.12
Event Timeline
Comment Actions
This seems not to work in Kleopatra/gpg in gpg4win-5.0.0-beta413 @ win11.
Given keymngr.conf:
keyserver ldap.gnupg.test:389:uid=LordPrivySeal,ou=GnuPG Users,dc=gnupg,dc=test:pass:dc=gnupg,dc=test:
To reproduce in Kleopatra
- Create a new cert (expiration e.g. 29.11.25) and export the "old" public key
- Change the expiration (e.g. 01.01.26), certify the cert with another cert (exportable) and export the "new" public key
- Upload the new public key to ldap
- Delete the cert from keyring
- Import the old public key
- Upload the old public key -> The new public key with extended expiration and additional signature is overwritten by the old public key
dirmngr.log: (on "Publish on Server..." in Kleopatra)
2025-11-28 09:27:36 dirmngr[8020] listening on socket 'C:\\Users\\g10\\AppData\\Local\\gnupg\\S.dirmngr' 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'ROOT': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'CA': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] error loading certificate 'CA': Certificate expired 2025-11-28 09:27:36 dirmngr[8020] permanently loaded certificates: 27 2025-11-28 09:27:36 dirmngr[8020] runtime cached certificates: 0 2025-11-28 09:27:36 dirmngr[8020] trusted certificates: 27 (27,0,0,0) 2025-11-28 09:27:36 dirmngr[8020] handler for fd 744 started 2025-11-28 09:27:40 dirmngr[8020] ldap connect to 'ldap.gnupg.test:389:uid=LordPrivySeal,ou=GnuPG Users,dc=gnupg,dc=test:*****:dc=gnupg,dc=test:plain' 2025-11-28 09:27:40 dirmngr[8020] ldap timeout set to 15s 2025-11-28 09:27:40 dirmngr[8020] DBG: my_ldap_connect: ldap_bind to 'uid=LordPrivySeal,ou=GnuPG Users,dc=gnupg,dc=test' succeeded 2025-11-28 09:27:40 dirmngr[8020] DBG: interrogate_ldap_dn: searched for 'cn=pgpServerInfo,dc=gnupg,dc=test': ldaprc=0 2025-11-28 09:27:40 dirmngr[8020] DBG: interrogate_ldap_dn: baseDN='ou=GnuPG Keys,dc=gnupg,dc=test' 2025-11-28 09:27:40 dirmngr[8020] DBG: interrogate_ldap_dn: pgpSoftware: GnuPG 2025-11-28 09:27:40 dirmngr[8020] DBG: interrogate_ldap_dn: pgpVersion: 2 schema2 2025-11-28 09:27:40 dirmngr[8020] DBG: my_ldap_connect: serverinfo set to realldap; basedn 'ou=GnuPG Keys,dc=gnupg,dc=test' 2025-11-28 09:27:40 dirmngr[8020] DBG: ldap_conn: 0x000000000013c5a8 2025-11-28 09:27:40 dirmngr[8020] DBG: server_type: LDAP 2025-11-28 09:27:40 dirmngr[8020] DBG: basedn: ou=GnuPG Keys,dc=gnupg,dc=test 2025-11-28 09:27:40 dirmngr[8020] DBG: pgpkeyattr: pgpKey 2025-11-28 09:27:40 dirmngr[8020] DBG: ks-ldap: using DN: pgpCertID=55C296C8553C8217,ou=GnuPG Keys,dc=gnupg,dc=test 2025-11-28 09:27:40 dirmngr[8020] handler for fd 744 terminated
To reproduce in gpg
- version
> gpg --version gpg (GnuPG) 2.5.14 libgcrypt 1.11.2
- ldap has new pubkey (verfällt: 2026-01-01)
> gpg --search-keys 55C296C8553C8217
(1) ldap update before publish <ldap.update.before.publish@gnupg.test>
255 bit key 55C296C8553C8217, erzeugt: 2025-11-28, verfällt: 2026-01-01
Keys 1-1 of 1 for "55C296C8553C8217". Eingabe von Nummern, Nächste (N) oder Abbrechen (Q) > Q
gpg: error searching keyserver: Verarbeitung wurde abgebrochen
gpg: Suche auf dem Schlüsselserver fehlgeschlagen: Verarbeitung wurde abgebrochen- keyring has old pubkey (verfällt: 2025-11-29)
> gpg -k 55C296C8553C8217
pub ed25519 2025-11-28 [SC] [verfällt: 2025-11-29]
92BA41134173D963E133348055C296C8553C8217
uid [ unbekannt ] ldap update before publish <ldap.update.before.publish@gnupg.test>
sub cv25519 2025-11-28 [E] [verfällt: 2025-11-29]
DD46EEBBE9337CF63F88E84F9336281ADCC3D198- upload
> gpg -v --send-keys 55C296C8553C8217 gpg: enabled compatibility flags: gpg: Kein aktiver dirmngr - `C:\\Program Files\\GnuPG\\bin\\dirmngr.exe' wird gestartet gpg: Warte bis der Dirmngr bereit ist ... (8s) gpg: Warte bis der Dirmngr bereit ist ... (7s) gpg: Warte bis der Dirmngr bereit ist ... (6s) gpg: Verbindung zum Dirmngr aufgebaut gpg: Kein aktiver keyboxd - `C:\\Program Files\\GnuPG\\bin\\keyboxd.exe' wird gestartet gpg: Warte bis der Keyboxd bereit ist ... (8s) gpg: Verbindung zum Keyboxd aufgebaut gpg: sende Schlüssel 55C296C8553C8217 auf ldap.gnupg.test:389
- keyring still has old pubkey (verfällt: 2025-11-29)
> gpg -k ldap
pub ed25519 2025-11-28 [SC] [verfällt: 2025-11-29]
92BA41134173D963E133348055C296C8553C8217
uid [ unbekannt ] ldap update before publish <ldap.update.before.publish@gnupg.test>
sub cv25519 2025-11-28 [E] [verfällt: 2025-11-29]
DD46EEBBE9337CF63F88E84F9336281ADCC3D198- ldap now has the old pubkey, too (verfällt: 2025-11-29)
> gpg --search-keys ldap
(1) ldap update before publish <ldap.update.before.publish@gnupg.test>
255 bit key 55C296C8553C8217, erzeugt: 2025-11-28, verfällt: 2025-11-29
Keys 1-1 of 1 for "ldap". Eingabe von Nummern, Nächste (N) oder Abbrechen (Q) > Q
gpg: error searching keyserver: Verarbeitung wurde abgebrochen
gpg: Suche auf dem Schlüsselserver fehlgeschlagen: Verarbeitung wurde abgebrochendirmngr.log:
2025-11-28 09:50:38 dirmngr[2596] Es wird auf Socket `C:\\Users\\g10\\AppData\\Local\\gnupg\\S.dirmngr' gehört 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `ROOT': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `CA': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] Fehler beim Laden des Zertifikats `CA': Zertifikat abgelaufen 2025-11-28 09:50:38 dirmngr[2596] dauerhaft geladene Zertifikate: 27 2025-11-28 09:50:38 dirmngr[2596] zwischengespeicherte Zertifikate: 0 2025-11-28 09:50:38 dirmngr[2596] vertrauenswürdige Zertifikate: 27 (27,0,0,0) 2025-11-28 09:50:38 dirmngr[2596] Handhabungsroutine f r fd 704 gestartet 2025-11-28 09:50:42 dirmngr[2596] ldap connect to 'ldap.gnupg.test:389:uid=LordPrivySeal,ou=GnuPG Users,dc=gnupg,dc=test:*****:dc=gnupg,dc=test:plain' 2025-11-28 09:50:42 dirmngr[2596] ldap timeout set to 15s 2025-11-28 09:50:42 dirmngr[2596] DBG: my_ldap_connect: ldap_bind to 'uid=LordPrivySeal,ou=GnuPG Users,dc=gnupg,dc=test' succeeded 2025-11-28 09:50:42 dirmngr[2596] DBG: interrogate_ldap_dn: searched for 'cn=pgpServerInfo,dc=gnupg,dc=test': ldaprc=0 2025-11-28 09:50:42 dirmngr[2596] DBG: interrogate_ldap_dn: baseDN='ou=GnuPG Keys,dc=gnupg,dc=test' 2025-11-28 09:50:42 dirmngr[2596] DBG: interrogate_ldap_dn: pgpSoftware: GnuPG 2025-11-28 09:50:42 dirmngr[2596] DBG: interrogate_ldap_dn: pgpVersion: 2 schema2 2025-11-28 09:50:42 dirmngr[2596] DBG: my_ldap_connect: serverinfo set to realldap; basedn 'ou=GnuPG Keys,dc=gnupg,dc=test' 2025-11-28 09:50:42 dirmngr[2596] DBG: ldap_conn: 0x000000000080bfd8 2025-11-28 09:50:42 dirmngr[2596] DBG: server_type: LDAP 2025-11-28 09:50:42 dirmngr[2596] DBG: basedn: ou=GnuPG Keys,dc=gnupg,dc=test 2025-11-28 09:50:42 dirmngr[2596] DBG: pgpkeyattr: pgpKey 2025-11-28 09:50:42 dirmngr[2596] DBG: ks-ldap: using DN: pgpCertID=55C296C8553C8217,ou=GnuPG Keys,dc=gnupg,dc=test 2025-11-28 09:50:42 dirmngr[2596] Handhabungsroutine f r den fd 704 beendet
It's also the same output with --keyserver-option update-before-send:
> gpg --search-keys 55C296C8553C8217
(1) ldap update before publish <ldap.update.before.publish@gnupg.test>
255 bit key 55C296C8553C8217, erzeugt: 2025-11-28, verfällt: 2026-01-01
Keys 1-1 of 1 for "55C296C8553C8217". Eingabe von Nummern, Nächste (N) oder Abbrechen (Q) > Q
gpg: error searching keyserver: Verarbeitung wurde abgebrochen
gpg: Suche auf dem Schlüsselserver fehlgeschlagen: Verarbeitung wurde abgebrochen
> gpg -v --keyserver-option update-before-send --send-keys 55C296C8553C8217
gpg: enabled compatibility flags:
gpg: sende Schlüssel 55C296C8553C8217 auf ldap.gnupg.test:389
> gpg -k 55C296C8553C8217
pub ed25519 2025-11-28 [SC] [verfällt: 2025-11-29]
92BA41134173D963E133348055C296C8553C8217
uid [ unbekannt ] ldap update before publish <ldap.update.before.publish@gnupg.test>
sub cv25519 2025-11-28 [E] [verfällt: 2025-11-29]
DD46EEBBE9337CF63F88E84F9336281ADCC3D198
> gpg --search-keys 55C296C8553C8217
(1) ldap update before publish <ldap.update.before.publish@gnupg.test>
255 bit key 55C296C8553C8217, erzeugt: 2025-11-28, verfällt: 2025-11-29
Keys 1-1 of 1 for "55C296C8553C8217". Eingabe von Nummern, Nächste (N) oder Abbrechen (Q) > Q
gpg: error searching keyserver: Verarbeitung wurde abgebrochen
gpg: Suche auf dem Schlüsselserver fehlgeschlagen: Verarbeitung wurde abgebrochen