mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
agent: Return NO_SECKEY instead of ENONET for PKSIGN and others.
* agent/pksign.c (agent_pksign_do): Replace ENONET by NO_SECKEY. * agent/findkey.c (agent_key_from_file): No diagnostic for NO_SECKEY. * agent/pkdecrypt.c (agent_pkdecrypt): Replace checking for ENOENT.
This commit is contained in:
parent
3259862cb4
commit
3981ff15f3
@ -605,7 +605,11 @@ agent_key_from_file (ctrl_t ctrl, const char *cache_nonce,
|
|||||||
|
|
||||||
rc = read_key_file (grip, &s_skey);
|
rc = read_key_file (grip, &s_skey);
|
||||||
if (rc)
|
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
|
/* For use with the protection functions we also need the key as an
|
||||||
canonical encoded S-expression in a buffer. Create this buffer
|
canonical encoded S-expression in a buffer. Create this buffer
|
||||||
|
@ -72,9 +72,7 @@ agent_pkdecrypt (ctrl_t ctrl, const char *desc_text,
|
|||||||
CACHE_MODE_NORMAL, NULL, &s_skey, NULL);
|
CACHE_MODE_NORMAL, NULL, &s_skey, NULL);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
if (gpg_err_code (rc) == GPG_ERR_ENOENT)
|
if (gpg_err_code (rc) != GPG_ERR_NO_SECKEY)
|
||||||
rc = gpg_error (GPG_ERR_NO_SECKEY);
|
|
||||||
else
|
|
||||||
log_error ("failed to read the secret key\n");
|
log_error ("failed to read the secret key\n");
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,8 @@ agent_pksign_do (ctrl_t ctrl, const char *cache_nonce,
|
|||||||
&s_skey, NULL);
|
&s_skey, NULL);
|
||||||
if (rc)
|
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;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,8 +210,8 @@ check_hijacking (assuan_context_t ctx)
|
|||||||
|
|
||||||
init_membuf (&mb, 64);
|
init_membuf (&mb, 64);
|
||||||
|
|
||||||
/* AGENT_ID is a command implemented by gnome-keyring-daemon. IT
|
/* AGENT_ID is a command implemented by gnome-keyring-daemon. It
|
||||||
does not reatun any data but an OK line with a remark. */
|
does not return any data but an OK line with a remark. */
|
||||||
if (assuan_transact (ctx, "AGENT_ID",
|
if (assuan_transact (ctx, "AGENT_ID",
|
||||||
membuf_data_cb, &mb, NULL, NULL, NULL, NULL))
|
membuf_data_cb, &mb, NULL, NULL, NULL, NULL))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user