summaryrefslogtreecommitdiffstats
path: root/scd/app-common.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-11-24 18:02:05 +0100
committerWerner Koch <wk@gnupg.org>2020-11-25 10:23:55 +0100
commit3a8250c02031080c6c8eebd5dea03f5f87f9ddd7 (patch)
tree5d019056fed75c9ff42252e1e3e3196730c3ca3c /scd/app-common.h
parentscd: Fix an error return for READKEY. (diff)
downloadgnupg2-3a8250c02031080c6c8eebd5dea03f5f87f9ddd7.tar.xz
gnupg2-3a8250c02031080c6c8eebd5dea03f5f87f9ddd7.zip
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>
Diffstat (limited to 'scd/app-common.h')
-rw-r--r--scd/app-common.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/scd/app-common.h b/scd/app-common.h
index ed2a549ae..ad96fc2d6 100644
--- a/scd/app-common.h
+++ b/scd/app-common.h
@@ -235,9 +235,10 @@ const char *strapptype (apptype_t t);
void app_update_priority_list (const char *arg);
gpg_error_t app_send_card_list (ctrl_t ctrl);
gpg_error_t app_send_active_apps (card_t card, ctrl_t ctrl);
-char *card_get_serialno (card_t card, int is_canonical);
+char *card_get_serialno (card_t card);
char *app_get_serialno (app_t app);
-char *yubikey_get_serialno (app_t app);
+char *card_get_dispserialno (card_t card, int nofallback);
+char *app_get_dispserialno (app_t app, int nofallback);
void app_dump_state (void);
void application_notify_card_reset (int slot);