scd: Support PASSWD --clear for OpenPGP card.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 23 Jan 2019 03:01:51 +0000 (12:01 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 23 Jan 2019 03:12:54 +0000 (12:12 +0900)
commitfec75a3868da72196f76aca95c7ab07debb7dc04
tree2c62375a68db65a32f7ecf56d6fe92b4473aefc3
parentf97dc55ff1b041071bc3cbe98aa761bf77bb7ac8
scd: Support PASSWD --clear for OpenPGP card.

* scd/app-openpgp.c (do_change_pin): Implement handling
APP_CHANGE_FLAG_CLEAR.

--

It is specified in the specification version 3.1 or later.  Some
version 2 cards (including Gnuk) support this feature.  Any version 1
card has no support for this feature.

For CHVNO = 1, it clears for both of 81 and 82; That is, user's key
usages for signing and others (decryption and auth).
For CHVNO = 3, it clears for 83, admin key.

For CHVNO = 2, it clears 82; That is, user's key usages
others (decryption and auth).

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/app-openpgp.c