mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
scd: Rework the handling of the displayed serial number.
* scd/app.c (app_new_register): Call app_munge_serialno for Yubikeys. (app_munge_serialno): Handle Yubikey serial numbers. (card_get_serialno): Remove special Yubikey treatment. Drop arg is_canonical. (app_get_serialno): Clear ERRNO on error. (card_get_dispserialno): New. Also change formatting of Yubikey and OpenPGP numbers to match those printed on the card. (app_get_dispserialno): New. * scd/app-openpgp.c (do_getattr): Use app_get_dispserialno. (yubikey_get_serialno): Remove. * scd/app-piv.c (get_dispserialno): Remove. (do_getattr): Use app_get_dispserialno. -- This patch gets us back to a unique serial number for cards and provides a stable serial number as printed for Yubikeys. Because we use a slightly different serial number now for Yubikeys and cards only supporting OpenPGP card we need to come up with another change so that the version number of OpenPGP serial numbers are ignored when comparing card serial numbers. This is so that existing stub keys of gpg-agent will continue to work. GnuPG-bug-id: 5100 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
c3a20c88fb
commit
3a8250c020
5 changed files with 180 additions and 121 deletions
|
@ -345,7 +345,7 @@ cmd_serialno (assuan_context_t ctx, char *line)
|
|||
return rc;
|
||||
}
|
||||
|
||||
serial = card_get_serialno (ctrl->card_ctx, 0);
|
||||
serial = card_get_serialno (ctrl->card_ctx);
|
||||
if (!serial)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
||||
|
@ -521,7 +521,7 @@ cmd_learn (assuan_context_t ctx, char *line)
|
|||
send_status_direct (ctrl, "READER", reader);
|
||||
/* No need to free the string of READER. */
|
||||
|
||||
serial = card_get_serialno (ctrl->card_ctx, 1);
|
||||
serial = card_get_serialno (ctrl->card_ctx);
|
||||
if (!serial)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue