diff options
author | Werner Koch <[email protected]> | 2009-02-27 14:36:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2009-02-27 14:36:59 +0000 |
commit | ec4a3eb3c5b45321125a9b1fb2b8cd5ee20c52de (patch) | |
tree | 4ee2b19d3f5b44349fe36a40f28d0835e51d9fd8 /g10/call-agent.c | |
parent | Fixed a nasty bug in scdaemon which led to a card reset if the card was (diff) | |
download | gnupg-ec4a3eb3c5b45321125a9b1fb2b8cd5ee20c52de.tar.gz gnupg-ec4a3eb3c5b45321125a9b1fb2b8cd5ee20c52de.zip |
Fix a gpg2 problem with removed cards.
Allow runtime conf change for scdaemon.
New commands for scdaemon.
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 57d963dfd..572fa8513 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -698,6 +698,15 @@ agent_scd_pksign (const char *serialno, int hashalgo, if (indatalen*2 + 50 > DIM(line)) return gpg_error (GPG_ERR_GENERAL); + /* 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. We request the openpgp + card because that is waht we expect. */ + rc = assuan_transact (agent_ctx, "SCD SERIALNO openpgp", + NULL, NULL, NULL, NULL, NULL, NULL); + if (rc) + return rc; + sprintf (line, "SCD SETDATA "); p = line + strlen (line); for (i=0; i < indatalen ; i++, p += 2 ) @@ -754,6 +763,15 @@ agent_scd_pkdecrypt (const char *serialno, if (indatalen*2 + 50 > DIM(line)) return gpg_error (GPG_ERR_GENERAL); + /* 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. We request the openpgp + card because that is waht we expect. */ + rc = assuan_transact (agent_ctx, "SCD SERIALNO openpgp", + NULL, NULL, NULL, NULL, NULL, NULL); + if (rc) + return rc; + sprintf (line, "SCD SETDATA "); p = line + strlen (line); for (i=0; i < indatalen ; i++, p += 2 ) |