35 |
#include "wptFileManager.h" |
#include "wptFileManager.h" |
36 |
#include "../resource.h" |
#include "../resource.h" |
37 |
|
|
38 |
|
bool secret_key_available (gpgme_recipient_t rset); |
39 |
|
|
40 |
/* Return the primary user-ID of the key with the keyid @keyid. |
/* Return the primary user-ID of the key with the keyid @keyid. |
41 |
Caller must free string. */ |
Caller must free string. */ |
42 |
char* |
char* |
119 |
agent_del_cache (pwd.keyid); |
agent_del_cache (pwd.keyid); |
120 |
|
|
121 |
res = gpgme_op_decrypt_result (ctx); |
res = gpgme_op_decrypt_result (ctx); |
122 |
if (err == gpg_error (GPG_ERR_NO_SECKEY) && res->recipients) { |
if (err && res->recipients && !secret_key_available (res->recipients)) { |
123 |
gpgme_recipient_t r = res->recipients; |
gpgme_recipient_t r = res->recipients; |
124 |
char *p = get_key_userid (r->keyid+8); |
char *p = get_key_userid (r->keyid+8); |
125 |
|
|
131 |
goto leave; |
goto leave; |
132 |
} |
} |
133 |
else if (err) { |
else if (err) { |
134 |
gpgme_pgptype_t pgp_type; |
gpg_pgptype_t pgp_type; |
135 |
gpgme_clip_get_pgptype (&pgp_type); |
gpg_clip_get_pgptype (&pgp_type); |
136 |
if (err == gpg_error (GPG_ERR_NO_DATA) && (pgp_type & PGP_MESSAGE)) |
if (gpgme_err_code (err) == GPG_ERR_NO_DATA && (pgp_type & PGP_MESSAGE)) |
137 |
msg_box (hwnd, _("Broken OpenPGP message (maybe: quoted printable " |
msg_box (hwnd, _("Broken OpenPGP message (maybe: quoted printable " |
138 |
"character in armor)."), _("Decryption"), MB_INFO); |
"character in armor)."), _("Decryption"), MB_INFO); |
139 |
else |
else |