Page MenuHome GnuPG

Kleopatra: General error when aborting subkey generation
Open, Needs TriagePublic

Description

In the VSD testversion I chose "Add subkey", then started the subkey creation with OK and on the password dialog hit cancel.
This resulted in a general error:

In Gpg4win there is no issue, the operation is silently canceled when cancelling the operation at the pinentry window.

gpg said:

4 - 2024-12-20 12:24:30 gpg[3788]: pinentry launched (952 qt5 1.3.1 /dev/tty - - ? 0/0 -)
4 - 2024-12-20 12:24:36 gpg[3788]: agent_genkey failed: Verarbeitung wurde abgebrochen
4 - 2024-12-20 12:24:36 gpg[3788]: Schlüsselerzeugung fehlgeschlagen: Verarbeitung wurde abgebrochen
4 - 2024-12-20 12:24:36 gpg[3788]: Schlüssel ist nicht geändert worden, also ist kein Speichern nötig.

Debugview:

3609	34000.102804	6952	kleopatra.exe	org.kde.pim.libkleo: errorAsString gettext_use_utf8(-1) returns 1
3610	34000.102912	6952	kleopatra.exe	org.kde.pim.libkleo: errorAsString error: "Allgemeiner Fehler"
3611	34000.103294	6952	kleopatra.exe	org.kde.pim.libkleo: errorAsString error (percent-encoded): "Allgemeiner%20Fehler"

Details

Version
VS-Desktop-3.2.94.474-Beta

Event Timeline

ikloecker added a subscriber: ikloecker.

Looks like gpg 2.2 doesn't emit a canceled status log message, but gpg 2.4 does if the problem only occurs with VSD but not with Gpg4win.

Compare the lines starting with [GNUPG:] issued by gpg 2.2

$ gpg --version
gpg (GnuPG) 2.2.45-beta27
libgcrypt 1.8.12-beta1
NOTE: THIS IS A DEVELOPMENT VERSION!
It is only intended for test purposes and should NOT be
used in a production environment or with production keys!
Copyright (C) 2024 g10 Code GmbH
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/ingo/dev/g10/.gnupghomes/2.4
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

$ gpg --status-fd 2 --quick-add-key 98111E67AE06F2BEFD2BDE10C5D6C919005F36A4
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: enabled debug flags: memstat
gpg: enabled compatibility flags:
[GNUPG:] KEY_CONSIDERED 98111E67AE06F2BEFD2BDE10C5D6C919005F36A4 0
gpg: pinentry launched (34252 qt 1.3.1 /dev/pts/71 xterm-256color :0 20600/1000/5 1000/1000 0)
[GNUPG:] PINENTRY_LAUNCHED 34252 qt 1.3.1 /dev/pts/71 xterm-256color :0 20600/1000/5 1000/1000 0
gpg: Key generation failed: Operation cancelled
gpg: Key not changed so no update needed.
gpg: keydb: handles=1 locks=0 parse=1 get=1
gpg:        build=0 update=0 insert=0 delete=0
gpg:        reset=0 found=1 not=0 cache=0 not=0
gpg: kid_not_found_cache: count=0 peak=0 flushes=0
gpg: sig_cache: total=2 cached=2 good=2 bad=0
gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
              outmix=0 getlvl1=0/0 getlvl2=0/0
gpg: rndjent stat: collector=0x0000000000000000 calls=0 bytes=0
gpg: secmem usage: 0/32768 bytes in 0 blocks

with those issued by gpg 2.4

$ gpg --version
gpg (GnuPG) 2.4.6-beta102
libgcrypt 1.11.1-beta31
NOTE: THIS IS A DEVELOPMENT VERSION!
It is only intended for test purposes and should NOT be
used in a production environment or with production keys!
Copyright (C) 2024 g10 Code GmbH
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/ingo/dev/g10/.gnupghomes/2.4
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

$ gpg --status-fd 2 --quick-add-key 98111E67AE06F2BEFD2BDE10C5D6C919005F36A4
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
[GNUPG:] KEY_CONSIDERED 98111E67AE06F2BEFD2BDE10C5D6C919005F36A4 0
[GNUPG:] PINENTRY_LAUNCHED 34362 qt 1.3.1 /dev/pts/72 xterm-256color :0 20600/1000/5 1000/1000 0
[GNUPG:] ERROR key_generate 83886179
[GNUPG:] KEY_NOT_CREATED 
[GNUPG:] FAILURE gpg-exit 33554433

where ERROR key_generate 83886179 translates to

$ gpg-error 83886179
83886179 = (5, 99) = (GPG_ERR_SOURCE_PINENTRY, GPG_ERR_CANCELED) = (Pinentry, Operation cancelled)