Page MenuHome GnuPG

Kleopatra: wrong success message for changing validity in case of not available card key
Closed, ResolvedPublic

Description

Noticed when testing T6201:

In the certificate details click "change validity" for a key (partially) on a smart card (without expiry date):

Set a date -> ok -> request for card pops up -> cancel -> success message:

The validity is of course not changed.

Details

Version
VS-Desktop-3.2.0.0-beta229/231

Revisions and Commits

Event Timeline

ebo renamed this task from Kleopatra: wrong success message for changing validity in case of not available remote key to Kleopatra: wrong success message for changing validity in case of not available card key.Oct 18 2023, 9:30 AM
aheinecke triaged this task as Normal priority.Oct 18 2023, 9:49 AM
aheinecke added a subscriber: aheinecke.

This happens when cancelling the password entry on normal keys, too. The strange thing is, the changeexpirycommand already checks if "err.isCancelled" and should do nothing in that case.

gpg --status-fd 1 --quick-set-expire 5613BB868A64B1ABB26F3D44F7E017CAED158080 5                                 1
gpg: enabled debug flags: memstat
gpg: enabled compatibility flags:
[GNUPG:] KEY_CONSIDERED 5613BB868A64B1ABB26F3D44F7E017CAED158080 0
gpg: pinentry launched (14020 qt 1.2.1 /dev/pts/3 xterm-256color :1 20600/1000/5 1000/1000 0)
[GNUPG:] PINENTRY_LAUNCHED 14020 qt 1.2.1 /dev/pts/3 xterm-256color :1 20600/1000/5 1000/1000 0
gpg: signing failed: Operation cancelled
gpg: make_keysig_packet failed: Operation cancelled
[GNUPG:] ERROR set_expire 83886179
gpg-error 83886179                                                                                              2
83886179 = (5, 99) = (GPG_ERR_SOURCE_PINENTRY, GPG_ERR_CANCELED) = (Pinentry, Operation cancelled)

And GPGME also looks to see this correctly:

./run-genkey --setexpire 5613BB868A64B1ABB26F3D44F7E017CAED158080 5                                             1
run-genkey: gpgme_op_setexpire failed: Operation cancelled

So from a first look at the code I don't see where the issue is.

This has sparked my curiosity.

aheinecke changed the task status from Open to Testing.Oct 18 2023, 11:21 AM
aheinecke reassigned this task from aheinecke to ebo.
aheinecke moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

Fix was trivial, the classical cancel is not an error problem in the QGpgMEChangeExpiryJob

werner moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Oct 26 2023, 9:08 AM
werner added a subscriber: werner.

Can be tested with vsd 3.1.90.252

ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

tested with VS-Desktop-3.1.90.277-Beta

When changing validity for a key on a not connected card, I am now asked to insert it.

ebo edited projects, added vsd32 (vsd-3.2.0); removed vsd32.