card: Support factory reset for Yubikey PIV application.
authorWerner Koch <wk@gnupg.org>
Tue, 29 Jan 2019 12:28:10 +0000 (13:28 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 29 Jan 2019 12:46:52 +0000 (13:46 +0100)
commit79bed504e51034d960fcb858fb643901cad85913
tree681c06acc035906240fee574d7d590797817d9e7
parent9325c92284bb346d11c3591bb2ea88095989361a
card: Support factory reset for Yubikey PIV application.

* scd/app-common.h (struct app_ctx_s): Add field cardtype.
* scd/app.c (app_new_register): Set cardtype for yubikey.
(app_getattr): Add CARDTYPE.
(app_write_learn_status): Emit new attribute.
* scd/app-piv.c (do_getattr): Add CHV-USAGE.
(do_learn_status): Emit it.
* tools/card-tool.h (struct card_info_s): Add field cardtype.
* tools/card-call-scd.c (learn_status_cb): Parse "CARDTYPE".

* tools/gpg-card-tool.c (list_piv): Print PIN usage policy.
(list_card): Print card type.
(cmd_factoryreset): Implement for Yubikey with PIV.

Signed-off-by: Werner Koch <wk@gnupg.org>
scd/app-common.h
scd/app-piv.c
scd/app.c
tools/card-call-scd.c
tools/card-tool.h
tools/gpg-card-tool.c