aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpg-card-tool.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-01-30 16:48:41 +0000
committerWerner Koch <[email protected]>2019-01-30 16:51:32 +0000
commit0107984f9f55f84e4842642bceefd2181ec09dab (patch)
treee4bcf4784d85992061aab1001271ad9c2571f864 /tools/gpg-card-tool.c
parentcard: Print matching OpenPGP and X.509 data. (diff)
downloadgnupg-0107984f9f55f84e4842642bceefd2181ec09dab.tar.gz
gnupg-0107984f9f55f84e4842642bceefd2181ec09dab.zip
card: Cache the results from gpg and gpgsm.
* tools/card-tool-keys.c (keyblock_cache): New var. (release_keyblock): Factor code out to a new do_release_keyblock. Add a cache. (flush_keyblock_cache): New. (get_matching_keys): Use the cache. * tools/gpg-card-tool.c (cmds): Add command "reset". (interactive_loop): Implement reset. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/gpg-card-tool.c')
-rw-r--r--tools/gpg-card-tool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/gpg-card-tool.c b/tools/gpg-card-tool.c
index 321426bdd..07b8bc67b 100644
--- a/tools/gpg-card-tool.c
+++ b/tools/gpg-card-tool.c
@@ -312,6 +312,8 @@ main (int argc, char **argv)
break;
}
+ flush_keyblock_cache ();
+
if (err)
gnupg_status_printf (STATUS_FAILURE, "- %u", err);
else if (log_get_errorcount (0))
@@ -2639,6 +2641,7 @@ static struct
{ "passwd" , cmdPASSWD, 0, N_("menu to change or unblock the PIN")},
{ "verify" , cmdVERIFY, 0, N_("verify the PIN and list all data")},
{ "unblock" , cmdUNBLOCK,0, N_("unblock the PIN using a Reset Code")},
+ { "reset" , cmdRESET, 0, N_("send a reset to the card daemon")},
{ "factory-reset", cmdFACTORYRESET, 1, N_("destroy all keys and data")},
{ "kdf-setup", cmdKDFSETUP, 1, N_("setup KDF for PIN authentication")},
{ "key-attr", cmdKEYATTR, 1, N_("change the key attribute")},
@@ -2834,6 +2837,7 @@ interactive_loop (void)
"Send a RESET to the card daemon.", 0);
else
{
+ flush_keyblock_cache ();
err = scd_apdu (NULL, NULL);
}
break;