Home GnuPG
Diffusion GnuPG 0db9c83555b4

scd: Add a workaround for Yubikey.

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

Provenance
gniibeAuthored on Sep 8 2020, 4:41 AM
Parents
rG270c49b8c6ea: scd: Fix handling 0x00FA to support OpenPGP card 3.4.
Branches
Unknown
Tags
Unknown

Event Timeline

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?

/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);