aboutsummaryrefslogtreecommitdiffstats
path: root/g10/pubkey-enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/pubkey-enc.c')
-rw-r--r--g10/pubkey-enc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c
index ad0a77e59..e0a6e8ae1 100644
--- a/g10/pubkey-enc.c
+++ b/g10/pubkey-enc.c
@@ -132,6 +132,8 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
if (openpgp_pk_test_algo2 (k->pubkey_algo, PUBKEY_USAGE_ENC))
continue;
+ k->result = GPG_ERR_NO_SECKEY;
+
if (sk->pubkey_algo != k->pubkey_algo)
continue;
@@ -155,6 +157,7 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
rc = get_it (ctrl, k, dek, sk, keyid);
if (!rc)
{
+ k->result = 0;
if (!opt.quiet && !k->keyid[0] && !k->keyid[1])
log_info (_("okay, we are the anonymous recipient.\n"));
search_for_secret_keys = 0;