diff options
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 8a0b21a7a..64b5cd857 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -458,6 +458,19 @@ agent_learn (struct agent_card_info_s *info) if (rc) return rc; + /* Send the serialno command to initialize the connection. We don't + care about the data returned. If the card has already been + initialized, this is a very fast command. The main reason we + need to do this here is to handle a card removed case so that an + "l" command in --card-edit can be used to show ta newly inserted + card. We request the openpgp card because that is what we + expect. */ + rc = assuan_transact (agent_ctx, "SCD SERIALNO openpgp", + NULL, NULL, NULL, NULL, NULL, NULL); + if (rc) + return rc; + + memset (info, 0, sizeof *info); rc = assuan_transact (agent_ctx, "SCD LEARN --force", dummy_data_cb, NULL, default_inq_cb, NULL, |