diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2020-10-23 15:19:53 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2020-10-23 15:19:53 +0900 |
commit | 65c91e601ae93aee1a5fa399d4a5d4498ad76eda (patch) | |
tree | e0d638d758fe4c8b6b2db0f4150556b1ebf5db36 | |
parent | 41505f0ae544535b524a409d87aa2540607fc9a4 (diff) | |
download | gnupg-65c91e601ae93aee1a5fa399d4a5d4498ad76eda.tar.gz |
scd: Don't overwrite serialno for Yubikey.
* scd/app-openpgp.c (app_select_openpgp): Keep ->serialno.
--
GnuPG-bug-id: 5100
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r-- | scd/app-openpgp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 26c036b2e..8085fa812 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -6080,9 +6080,16 @@ app_select_openpgp (app_t app) app->appversion |= buffer[7]; manufacturer = (buffer[8]<<8 | buffer[9]); - xfree (app->card->serialno); - app->card->serialno = buffer; - app->card->serialnolen = buflen; + /* For Yubikey, serialno is set in app.c, already. */ + if (app->card->cardtype == CARDTYPE_YUBIKEY) + xfree (buffer); + else + { + xfree (app->card->serialno); + app->card->serialno = buffer; + app->card->serialnolen = buflen; + } + buffer = NULL; app->app_local = xtrycalloc (1, sizeof *app->app_local); if (!app->app_local) |