81 |
|
|
82 |
|
|
83 |
/* Return a general description of the key @key. */ |
/* Return a general description of the key @key. */ |
84 |
static char* |
char* |
85 |
key_get_info (gpgme_key_t pk, int is_sec) |
km_key_get_info (gpgme_key_t pk, int is_sec) |
86 |
{ |
{ |
87 |
const char *fmt = "%s %04d%s/0x%s %s\n \"%s\""; |
const char *fmt = "%s %04d%s/0x%s %s\n \"%s\""; |
88 |
char *p, *uid; |
char *p, *uid; |
463 |
_("Key Manager"), MB_INFO); |
_("Key Manager"), MB_INFO); |
464 |
} |
} |
465 |
|
|
466 |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_IMPORT, dlg, |
has_data = dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_IMPORT, dlg, |
467 |
clip_import_dlg_proc, 0, |
clip_import_dlg_proc, 0, |
468 |
_("Key Import"), IDS_WINPT_IMPORT); |
_("Key Import"), IDS_WINPT_IMPORT); |
469 |
|
if (!has_data) |
470 |
|
return WPTERR_GENERAL; |
471 |
return 0; |
return 0; |
472 |
} |
} |
473 |
|
|
529 |
gpgme_error_t err; |
gpgme_error_t err; |
530 |
fm_state_s fm_stat; |
fm_state_s fm_stat; |
531 |
gpgme_import_result_t res; |
gpgme_import_result_t res; |
532 |
|
int no_data = 0; |
533 |
|
|
534 |
memset (&fm_stat, 0, sizeof (fm_stat)); |
memset (&fm_stat, 0, sizeof (fm_stat)); |
535 |
fm_stat.opaque = m_strdup (fname); |
fm_stat.opaque = m_strdup (fname); |
561 |
} |
} |
562 |
|
|
563 |
res = gpgme_op_import_result (ctx); |
res = gpgme_op_import_result (ctx); |
564 |
|
if (res->unchanged == res->considered) |
565 |
|
no_data = 1; |
566 |
if (res->new_revocations == 0 && fm_stat.import.revcert == 1) |
if (res->new_revocations == 0 && fm_stat.import.revcert == 1) |
567 |
res->new_revocations = 1; |
res->new_revocations = 1; |
568 |
if (res->secret_imported == 0 && fm_stat.import.has_seckey == 1) |
if (res->secret_imported == 0 && fm_stat.import.has_seckey == 1) |
583 |
gpgme_data_release (keydata); |
gpgme_data_release (keydata); |
584 |
gpgme_release (ctx); |
gpgme_release (ctx); |
585 |
free_if_alloc (fm_stat.opaque); |
free_if_alloc (fm_stat.opaque); |
586 |
|
if (no_data) |
587 |
|
return WPTERR_GENERAL; |
588 |
return (int)err; |
return (int)err; |
589 |
} |
} |
590 |
|
|
642 |
BUG (NULL); |
BUG (NULL); |
643 |
seckey_type = km_check_for_seckey (lv, i, NULL); |
seckey_type = km_check_for_seckey (lv, i, NULL); |
644 |
if (confirm && !seckey_type) { |
if (confirm && !seckey_type) { |
645 |
p = key_get_info (key, 0); |
p = km_key_get_info (key, 0); |
646 |
rc = log_box (_("Key Manager"), MB_YESNO|MB_ICONWARNING, |
rc = log_box (_("Key Manager"), MB_YESNO|MB_ICONWARNING, |
647 |
_("Do you really want to delete this key?\n\n" |
_("Do you really want to delete this key?\n\n" |
648 |
"%s"), p); |
"%s"), p); |
652 |
free_if_alloc (p); |
free_if_alloc (p); |
653 |
} |
} |
654 |
else if (confirm) { |
else if (confirm) { |
655 |
p = key_get_info (key, 1); |
p = km_key_get_info (key, 1); |
656 |
rc = log_box (_("Key Manager"), MB_YESNO|MB_ICONWARNING, |
rc = log_box (_("Key Manager"), MB_YESNO|MB_ICONWARNING, |
657 |
_("Do you really want to delete this KEY PAIR?\n\n" |
_("Do you really want to delete this KEY PAIR?\n\n" |
658 |
"Please remember that you are not able to decrypt\n" |
"Please remember that you are not able to decrypt\n" |
698 |
if (n == 0) |
if (n == 0) |
699 |
show_msg (dlg, 1500, _("GnuPG Status: Finished")); |
show_msg (dlg, 1500, _("GnuPG Status: Finished")); |
700 |
gpgme_release (ctx); |
gpgme_release (ctx); |
701 |
listview_del_items (lv); |
listview_del_sel_items (lv); |
702 |
delete_keys_from_cache (rset, k_pos); |
delete_keys_from_cache (rset, k_pos); |
703 |
free (rset); |
free (rset); |
704 |
|
|