[git] Scute - branch, master, updated. scute-1.5.0-12-ga148c21
by Werner Koch
cvs at cvs.gnupg.org
Mon Feb 18 15:20:23 CET 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PKCS#11 token on top of gpg-agent".
The branch, master has been updated
via a148c216517c6dcf2d339f5060c5b09164dd18c9 (commit)
from d981ad1ed18d5e7d7b63ecf256348a509cc4eb59 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a148c216517c6dcf2d339f5060c5b09164dd18c9
Author: Werner Koch <wk at gnupg.org>
Date: Mon Feb 18 15:19:51 2019 +0100
Properly handle card switching.
* src/agent.c (scute_agent_learn): Handle GPG_ERR_CARD_REMOVED.
--
diff --git a/src/agent.c b/src/agent.c
index 706fdf3..3316c97 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -712,6 +712,20 @@ scute_agent_learn (struct agent_card_info_s *info)
err = assuan_transact (agent_ctx, "LEARN --sendinfo",
NULL, NULL, default_inq_cb,
NULL, learn_status_cb, info);
+ if (gpg_err_source(err) == GPG_ERR_SOURCE_SCD
+ && gpg_err_code (err) == GPG_ERR_CARD_REMOVED)
+ {
+ /* SCD session is in card removed state. clear that state. */
+ err = assuan_transact (agent_ctx, "SCD SERIALNO",
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ if (!err)
+ {
+ memset (info, 0, sizeof (*info));
+ err = assuan_transact (agent_ctx, "LEARN --sendinfo",
+ NULL, NULL, default_inq_cb,
+ NULL, learn_status_cb, info);
+ }
+ }
return err;
}
-----------------------------------------------------------------------
Summary of changes:
src/agent.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
hooks/post-receive
--
PKCS#11 token on top of gpg-agent
http://git.gnupg.org
More information about the Gnupg-commits
mailing list