138 |
} |
} |
139 |
|
|
140 |
|
|
|
/* Return human printable PKA status. |
|
|
If no pka information is available, return NULL. */ |
|
|
char* |
|
|
get_pka_status (gpgme_signature_t sig) |
|
|
{ |
|
|
const char *fmt; |
|
|
char *pka_inf; |
|
|
|
|
|
if (sig->pka_trust == 0 || !sig->pka_address) |
|
|
return NULL; |
|
|
fmt = _("PKA: Verified signer's address is '%s'"); |
|
|
pka_inf = new char[strlen (fmt)+strlen (sig->pka_address)+2]; |
|
|
if (!pka_inf) |
|
|
BUG (NULL); |
|
|
sprintf (pka_inf, fmt, sig->pka_address); |
|
|
return pka_inf; |
|
|
} |
|
|
|
|
|
|
|
141 |
/* Dialog procedure for the clipboard verification. */ |
/* Dialog procedure for the clipboard verification. */ |
142 |
BOOL CALLBACK |
BOOL CALLBACK |
143 |
clip_verify_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
clip_verify_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
144 |
{ |
{ |
145 |
static listview_ctrl_t lv = NULL; |
static verlist_ctrl_t vlv = NULL; |
146 |
static text_input_s *ctx = NULL; |
text_input_s *ctx; |
147 |
gpgme_error_t err; |
gpgme_error_t err; |
148 |
gpgme_signature_t sig = NULL, s; |
gpgme_signature_t sig = NULL, s; |
149 |
gpg_keycache_t kc = NULL; |
gpg_keycache_t kc = NULL; |
224 |
EndDialog (dlg, FALSE); |
EndDialog (dlg, FALSE); |
225 |
return FALSE; |
return FALSE; |
226 |
} |
} |
227 |
verlist_build (&lv, GetDlgItem (dlg, IDC_VERIFY_SIGLIST), 0); |
verlist_build (&vlv, GetDlgItem (dlg, IDC_VERIFY_SIGLIST), 0); |
228 |
|
verlist_set_info_control (vlv, GetDlgItem (dlg, IDC_VERIFY_INFO)); |
229 |
|
|
230 |
for (s = sig; s; s = s->next) { |
for (s = sig; s; s = s->next) { |
231 |
rc = verlist_add_sig (lv, s); |
rc = verlist_add_sig (vlv, s); |
232 |
if (rc) |
if (rc) |
233 |
msg_box (dlg, _("Could not extract key or signature information."), |
msg_box (dlg, _("Could not extract key or signature information."), |
234 |
_("Verify"), MB_ERR); |
_("Verify"), MB_ERR); |
235 |
} |
} |
236 |
if (sig->exp_timestamp > (DWORD)time (NULL)) |
|
|
SetDlgItemText (dlg, IDC_VERIFY_INFO, _("The signature is expired!")); |
|
|
else { |
|
|
char *pka_info = get_pka_status (sig); |
|
|
if (pka_info != NULL) { |
|
|
SetDlgItemText (dlg, IDC_VERIFY_INFO, pka_info); |
|
|
free_if_alloc (pka_info); |
|
|
} |
|
|
} |
|
237 |
if (sig->notations) |
if (sig->notations) |
238 |
show_notation_data (dlg, sig->notations); |
show_notation_data (dlg, sig->notations); |
239 |
gpgme_release (c); |
gpgme_release (c); |
241 |
return TRUE; |
return TRUE; |
242 |
|
|
243 |
case WM_DESTROY: |
case WM_DESTROY: |
244 |
if (lv) { |
if (vlv) { |
245 |
listview_release (lv); |
verlist_delete (vlv); |
246 |
lv = NULL; |
vlv = NULL; |
247 |
} |
} |
248 |
return FALSE; |
return FALSE; |
249 |
|
|
|
case WM_SYSCOMMAND: |
|
|
if (LOWORD (wparam) == SC_CLOSE) |
|
|
EndDialog (dlg, TRUE); |
|
|
return FALSE; |
|
|
|
|
250 |
case WM_COMMAND: |
case WM_COMMAND: |
251 |
switch (LOWORD (wparam )) { |
switch (LOWORD (wparam )) { |
252 |
|
case IDCANCEL: |
253 |
|
EndDialog (dlg, FALSE); |
254 |
|
break; |
255 |
|
|
256 |
case IDOK: |
case IDOK: |
257 |
EndDialog (dlg, TRUE); |
EndDialog (dlg, TRUE); |
258 |
return FALSE; |
return FALSE; |