80 |
c = (passphrase_cb_s *)lparam; |
c = (passphrase_cb_s *)lparam; |
81 |
if (!c) |
if (!c) |
82 |
BUG (0); |
BUG (0); |
83 |
|
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
84 |
SetDlgItemText (dlg, IDC_DECRYPT_HIDE, _("&Hide Typing")); |
SetDlgItemText (dlg, IDC_DECRYPT_HIDE, _("&Hide Typing")); |
85 |
SetWindowText (dlg, c->title); |
SetWindowText (dlg, c->title); |
86 |
if (c->gpg_cmd == GPG_CMD_DECRYPT) { |
if (c->gpg_cmd == GPG_CMD_DECRYPT) { |
92 |
SetDlgItemText (dlg, IDC_DECRYPT_SIGN_HIDE, _("&Hide Typing")); |
SetDlgItemText (dlg, IDC_DECRYPT_SIGN_HIDE, _("&Hide Typing")); |
93 |
CheckDlgButton (dlg, IDC_DECRYPT_SIGN_HIDE, BST_CHECKED); |
CheckDlgButton (dlg, IDC_DECRYPT_SIGN_HIDE, BST_CHECKED); |
94 |
} |
} |
95 |
|
/* Because it depends on the order the keys are stored in the |
96 |
|
keyring whether res->recipients is complete or not, we also |
97 |
|
support that the recipients were externally extracted and then |
98 |
|
we use this list. */ |
99 |
if (c->recipients) |
if (c->recipients) |
100 |
recip = c->recipients; /* recipients were already extracted. */ |
recip = c->recipients; /* recipients were already extracted. */ |
101 |
else { |
else { |
|
/* XXX: not all ENCRYPT_TO entries are listed here. */ |
|
102 |
res = gpgme_op_decrypt_result (c->gpg); |
res = gpgme_op_decrypt_result (c->gpg); |
103 |
if (res && res->recipients) |
if (res && res->recipients) |
104 |
recip = res->recipients; |
recip = res->recipients; |
105 |
} |
} |
106 |
if (recip != NULL && c->gpg_cmd == GPG_CMD_DECRYPT) { |
if (recip != NULL && c->gpg_cmd == GPG_CMD_DECRYPT) { |
107 |
for (r = res->recipients; r; r = r->next) { |
for (r = recip; r; r = r->next) { |
108 |
get_pubkey (r->keyid, &key); |
get_pubkey (r->keyid, &key); |
109 |
if (key) { |
if (key) { |
110 |
|
gpgme_user_id_t u = key->uids; |
111 |
char *uid; |
char *uid; |
112 |
id = key->uids->name; |
|
113 |
|
id = u->name; |
114 |
if (!id) |
if (!id) |
115 |
id = _("Invalid User ID"); |
id = _("Invalid User ID"); |
116 |
uid = utf8_to_wincp (id, strlen (id)); |
uid = utf8_to_wincp (id, strlen (id)); |
117 |
info = new char [32+strlen (uid)+1 + 4 + strlen (r->keyid)+1 |
n = 32+strlen (uid)+1+4+strlen (r->keyid)+1; |
118 |
+ strlen (key->uids->email)+1]; |
if (u->email) |
119 |
|
n += strlen (u->email)+1; |
120 |
|
info = new char [n+1]; |
121 |
if (!info) |
if (!info) |
122 |
BUG (NULL); |
BUG (NULL); |
123 |
sprintf (info, "%s <%s> (%s, 0x%s)", uid, key->uids->email, |
if (!u->email || strlen (u->email) < 1) |
124 |
get_key_pubalgo (r->pubkey_algo), r->keyid+8); |
sprintf (info, "%s (%s, 0x%s)", uid, |
125 |
|
get_key_pubalgo (r->pubkey_algo), r->keyid+8); |
126 |
|
else |
127 |
|
sprintf (info, "%s <%s> (%s, 0x%s)", uid, u->email, |
128 |
|
get_key_pubalgo (r->pubkey_algo), r->keyid+8); |
129 |
free (uid); |
free (uid); |
|
|
|
130 |
} |
} |
131 |
else { |
else { |
132 |
info = new char [32 + strlen (r->keyid)+1 + 4]; |
info = new char [32 + strlen (r->keyid)+1 + 4]; |
167 |
} |
} |
168 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
169 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
|
set_active_window (dlg); |
|
170 |
return FALSE; |
return FALSE; |
171 |
|
|
172 |
case WM_SYSCOMMAND: |
case WM_SYSCOMMAND: |