aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-01-21 13:06:51 +0000
committerWerner Koch <[email protected]>2019-01-21 13:06:51 +0000
commit29929e65521279eabc98a67c766fe485057405a9 (patch)
treef26431890716048aef0f43d85efa3563046e7f15 /scd/app-openpgp.c
parentscd: Add very basic support for PIV cards. (diff)
downloadgnupg-29929e65521279eabc98a67c766fe485057405a9.tar.gz
gnupg-29929e65521279eabc98a67c766fe485057405a9.zip
scd: Add option --clear to PASSWD.
* scd/command.c (cmd_passwd): Add option --clear. (send_status_printf): New. * scd/app-common.h (APP_CHANGE_FLAG_CLEAR): New. * scd/app-nks.c (do_change_pin): Return an error if that option is used. * scd/app-openpgp.c (do_change_pin): Ditto. -- Card application may support this option to clear the PIN verification status of a specific PIN. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index f25a36062..fddc3b8cf 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -2602,10 +2602,14 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr,
int pinlen = 0;
(void)ctrl;
+
memset (&pininfo, 0, sizeof pininfo);
pininfo.fixedlen = -1;
pininfo.minlen = minlen;
+ if ((flags & APP_CHANGE_FLAG_CLEAR))
+ return gpg_error (GPG_ERR_UNSUPPORTED_OPERATION);
+
if (reset_mode && chvno == 3)
{
rc = gpg_error (GPG_ERR_INV_ID);