mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
scd: Detect Yubikey and provide nicer display-s/n.
* scd/app-common.h (struct app_ctx_s): Rename unused field card_version to cardversion. * scd/app.c (app_new_register): Add code rom 2.3 to detect the Yubikey and set cardversion. (app_get_dispserialno): New. * scd/app-openpgp.c (do_getattr): Use app_get_dispserialno.
This commit is contained in:
parent
43b3ec5aee
commit
f8588369bc
3 changed files with 182 additions and 11 deletions
|
@ -1084,17 +1084,14 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
|
|||
}
|
||||
if (table[idx].special == -4)
|
||||
{
|
||||
char *serial = app_get_serialno (app);
|
||||
char *serial = app_get_dispserialno (app, 0);
|
||||
|
||||
if (serial)
|
||||
{
|
||||
if (strlen (serial) > 16+12)
|
||||
{
|
||||
send_status_info (ctrl, table[idx].name, serial+16, 12, NULL, 0);
|
||||
xfree (serial);
|
||||
return 0;
|
||||
}
|
||||
send_status_info (ctrl, table[idx].name,
|
||||
serial, strlen (serial), NULL, 0);
|
||||
xfree (serial);
|
||||
return 0;
|
||||
}
|
||||
return gpg_error (GPG_ERR_INV_NAME);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue