From 8ff36630277f05fbe4e43c7d757eb90da8645e3f Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 16 Sep 2020 13:13:29 +0900 Subject: [PATCH] scd: Clear PIN cache when changing key attributes. * scd/app-openpgp.c (change_keyattr): Clear all PINs. Signed-off-by: NIIBE Yutaka --- scd/app-openpgp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 3d96467bf..465819adc 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -3767,7 +3767,7 @@ build_ecc_privkey_template (app_t app, int keyno, } -/* Helper for do_writekley to change the size of a key. Not ethat +/* Helper for do_writekey to change the size of a key. Not ethat this deletes the entire key without asking. */ static gpg_error_t change_keyattr (app_t app, ctrl_t ctrl, @@ -3796,6 +3796,9 @@ change_keyattr (app_t app, ctrl_t ctrl, app->did_chv1 = 0; app->did_chv2 = 0; app->did_chv3 = 0; + cache_pin (app, ctrl, 1, NULL); + cache_pin (app, ctrl, 2, NULL); + cache_pin (app, ctrl, 3, NULL); return err; }