diff options
-rw-r--r-- | agent/findkey.c | 6 | ||||
-rw-r--r-- | agent/pkdecrypt.c | 4 | ||||
-rw-r--r-- | agent/pksign.c | 3 | ||||
-rw-r--r-- | g10/call-agent.c | 4 |
4 files changed, 10 insertions, 7 deletions
diff --git a/agent/findkey.c b/agent/findkey.c index 8725afbf3..5ff263ef4 100644 --- a/agent/findkey.c +++ b/agent/findkey.c @@ -605,7 +605,11 @@ agent_key_from_file (ctrl_t ctrl, const char *cache_nonce, rc = read_key_file (grip, &s_skey); if (rc) - return rc; + { + if (gpg_err_code (rc) == GPG_ERR_ENOENT) + rc = gpg_error (GPG_ERR_NO_SECKEY); + return rc; + } /* For use with the protection functions we also need the key as an canonical encoded S-expression in a buffer. Create this buffer diff --git a/agent/pkdecrypt.c b/agent/pkdecrypt.c index 14aa78f75..945de3c51 100644 --- a/agent/pkdecrypt.c +++ b/agent/pkdecrypt.c @@ -72,9 +72,7 @@ agent_pkdecrypt (ctrl_t ctrl, const char *desc_text, CACHE_MODE_NORMAL, NULL, &s_skey, NULL); if (rc) { - if (gpg_err_code (rc) == GPG_ERR_ENOENT) - rc = gpg_error (GPG_ERR_NO_SECKEY); - else + if (gpg_err_code (rc) != GPG_ERR_NO_SECKEY) log_error ("failed to read the secret key\n"); goto leave; } diff --git a/agent/pksign.c b/agent/pksign.c index 713c8ba79..9147b50d0 100644 --- a/agent/pksign.c +++ b/agent/pksign.c @@ -312,7 +312,8 @@ agent_pksign_do (ctrl_t ctrl, const char *cache_nonce, &s_skey, NULL); if (rc) { - log_error ("failed to read the secret key\n"); + if (gpg_err_code (rc) != GPG_ERR_NO_SECKEY) + log_error ("failed to read the secret key\n"); goto leave; } diff --git a/g10/call-agent.c b/g10/call-agent.c index cf1b96af2..58f4a92c5 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -210,8 +210,8 @@ check_hijacking (assuan_context_t ctx) init_membuf (&mb, 64); - /* AGENT_ID is a command implemented by gnome-keyring-daemon. IT - does not reatun any data but an OK line with a remark. */ + /* AGENT_ID is a command implemented by gnome-keyring-daemon. It + does not return any data but an OK line with a remark. */ if (assuan_transact (ctx, "AGENT_ID", membuf_data_cb, &mb, NULL, NULL, NULL, NULL)) { |