43 |
|
|
44 |
const char* get_symkey_algo (int algo); |
const char* get_symkey_algo (int algo); |
45 |
|
|
46 |
#define item_ctrl_id( cmd ) \ |
#define item_ctrl_id(cmd) \ |
47 |
((cmd) == GPG_CMD_DECRYPT? IDC_DECRYPT_PWD : IDC_DECRYPT_SIGN_PWD) |
((cmd) == GPG_CMD_DECRYPT? IDC_DECRYPT_PWD : IDC_DECRYPT_SIGN_PWD) |
48 |
|
|
49 |
#define item_ctrl_id2(cmd) \ |
#define item_ctrl_id2(cmd) \ |
76 |
int n; |
int n; |
77 |
|
|
78 |
switch (msg) { |
switch (msg) { |
79 |
|
case WM_ACTIVATE: |
80 |
|
safe_edit_control_init (dlg, item_ctrl_id (c->gpg_cmd)); |
81 |
|
break; |
82 |
|
|
83 |
|
case WM_DESTROY: |
84 |
|
safe_edit_control_free (dlg, item_ctrl_id (c->gpg_cmd)); |
85 |
|
break; |
86 |
|
|
87 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
88 |
c = (passphrase_cb_s *)lparam; |
c = (passphrase_cb_s *)lparam; |
89 |
if (!c) |
if (!c) |
216 |
c->pwd = new char[n+2]; |
c->pwd = new char[n+2]; |
217 |
if (!c->pwd) |
if (!c->pwd) |
218 |
BUG (NULL); |
BUG (NULL); |
219 |
GetDlgItemText (dlg, item_ctrl_id (c->gpg_cmd), c->pwd, n+1); |
SafeGetDlgItemText (dlg, item_ctrl_id (c->gpg_cmd), |
220 |
|
c->pwd, n+1); |
221 |
} |
} |
222 |
res = gpgme_op_decrypt_result (c->gpg); |
res = gpgme_op_decrypt_result (c->gpg); |
223 |
if (!res) |
if (!res) |
401 |
} |
} |
402 |
else if (uid_hint) |
else if (uid_hint) |
403 |
parse_gpg_description (uid_hint, passphrase_info, |
parse_gpg_description (uid_hint, passphrase_info, |
404 |
c->info, sizeof c->info - 1); |
c->info, sizeof (c->info) - 1); |
405 |
if (c->gpg_cmd == GPG_CMD_DECRYPT) { |
if (c->gpg_cmd == GPG_CMD_DECRYPT) { |
406 |
rc = DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_DECRYPT, |
rc = DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_DECRYPT, |
407 |
(HWND)c->hwnd, passphrase_callback_proc, |
(HWND)c->hwnd, passphrase_callback_proc, |