Diffusion GnuPG 0db9c83555b4

scd: Add a workaround for Yubikey.

Authored by gniibe on Sep 8 2020, 4:41 AM.

Description

scd: Add a workaround for Yubikey.

* scd/app-openpgp.c (get_public_key): Handle wrong code for Yubikey.

Yubikey version 5 s/n 609074582 returns 0x6982, version 5.2.4 s/n
610616049 returns 0x6581, where 0x6a88 is expected.

  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Committed
gniibeSep 8 2020, 4:41 AM
Parents
rG270c49b8c6ea: scd: Fix handling 0x00FA to support OpenPGP card 3.4.
Branches
Unknown
Tags
Unknown
werner added a subscriber: werner.Sep 8 2020, 8:24 AM
werner added inline comments.
/scd/app-openpgp.c
1947

Wouldn't it be better to remap the error code after the message, so that there is a chance to see the original error?

gniibe added inline comments.Sep 9 2020, 2:06 AM
/scd/app-openpgp.c
1947

The error code doesn't affect any user interactions, but only this debug message.
(There are no use cases of checking the return value of get_public_key.)
It is shown in the debug log.

Original intention (of yours) seemed less surprising debug message.

Given the situation we know some erroneous behavior of Yubikey, it's OK just ignore the original return value.

Or, we can do something similar as handling 0x00FA object which does:

if (opt.verbose)
  log_info ("Yubikey bug: length %zu != %zu", valuelen, len);