aboutsummaryrefslogtreecommitdiffstats
path: root/tools/card-call-scd.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-04-01 08:34:06 +0000
committerWerner Koch <[email protected]>2021-04-01 08:34:06 +0000
commitc727951a2440913bbab5b250c9bd2bb1d35ab0d7 (patch)
treefb90571a1ac0749129287fd21955251d2ed8d360 /tools/card-call-scd.c
parentscd: New flag --reread for LEARN (diff)
downloadgnupg-c727951a2440913bbab5b250c9bd2bb1d35ab0d7.tar.gz
gnupg-c727951a2440913bbab5b250c9bd2bb1d35ab0d7.zip
card: New flag --reread for LIST.
* tools/gpg-card.c (cmd_list): Add flag --reread. * tools/card-call-scd.c (scd_learn): New arg reread. * tools/card-call-scd.c (release_card_info): Fix releasing of the new label var. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/card-call-scd.c')
-rw-r--r--tools/card-call-scd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/card-call-scd.c b/tools/card-call-scd.c
index 5a2b3001d..086503b1c 100644
--- a/tools/card-call-scd.c
+++ b/tools/card-call-scd.c
@@ -157,7 +157,7 @@ release_card_info (card_info_t info)
while (info->kinfo)
{
key_info_t kinfo = info->kinfo->next;
- xfree (kinfo->label);
+ xfree (info->kinfo->label);
xfree (info->kinfo);
info->kinfo = kinfo;
}
@@ -1151,7 +1151,7 @@ learn_status_cb (void *opaque, const char *line)
/* Call the scdaemon to learn about a smartcard. This fills INFO
* with data from the card. */
gpg_error_t
-scd_learn (card_info_t info)
+scd_learn (card_info_t info, int reread)
{
gpg_error_t err;
struct default_inq_parm_s parm;
@@ -1168,7 +1168,9 @@ scd_learn (card_info_t info)
return err;
parm.ctx = agent_ctx;
- err = assuan_transact (agent_ctx, "SCD LEARN --force",
+ err = assuan_transact (agent_ctx,
+ reread? "SCD LEARN --force --reread"
+ /* */: "SCD LEARN --force",
dummy_data_cb, NULL, default_inq_cb, &parm,
learn_status_cb, info);
/* Also try to get some other key attributes. */