Page MenuHome GnuPG

Kleopatra reader selection and quoting
Closed, ResolvedPublic

Description

A Yubikey has for example the name "Yubikey [...] OTP+CCID 0". The Kleopatra drop down box however does not display (or at least use) the "+" from that string and puts "Yubikey [...] OTP CCID 0" into scdaemon.conf. Thus the Yubikey is not found.

Details

Version
vsd 3.1.20.3

Event Timeline

werner created this task.
werner created this object with edit policy "Contributor (Project)".

This looks like a missing escaping issue in the sender (scdaemon?) or an unwanted unescaping issue in the receiver of the string (which uses Kleo::hexdecode()).

werner added a subscriber: ikloecker.

Yes, kleo always maps '+' -> ' '

if (*it == '%') {
   [...]
} else if (*it == '+') {
    result += ' ';

it is a bit unforunate that our interfaces use percent escape with and without plus escaping. There is of course a good reason for this, but it is annoying. What shall we do? Escaping in scd seems to be the better thing, I guess.

Hmm, I looked at the gpg-side a bit. assuan_send_data that's used for returning GETINFO reader_list only does escaping "as required by the Assuan protocol", i.e. percent escaping of certain characters but no plus escaping.

I can live with the rule that data returned using the Assuan protocol is always percent escaped, but not plus escaped. I will add the unescaping to the low-level function that sends a command returning data, so that callers don't have to care about unescaping.

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

Doh! gpgme already performs the unescaping of data retrieved via the Assuan protocol for us in llass_status_handler. Doing it again in Kleo::SCDaemon::getReaders was simply wrong.

ikloecker changed the task status from Open to Testing.Jan 25 2022, 11:52 AM
ikloecker removed ikloecker as the assignee of this task.
ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
ebo claimed this task.
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
ebo added a subscriber: ebo.

works

ebo edited projects, added gnupg22 (test-gnupg-2.4.0); removed gnupg22.
ebo moved this task from test-gnupg-2.4.0 to Attic on the gnupg22 board.
ebo edited projects, added gnupg22; removed gnupg22 (test-gnupg-2.4.0).