65 |
|
|
66 |
struct keyedit_callback_s { |
struct keyedit_callback_s { |
67 |
gpgme_editkey_t ek; |
gpgme_editkey_t ek; |
68 |
const char * pass; |
const char *pass; |
69 |
listview_ctrl_t lv; |
listview_ctrl_t lv; |
70 |
void * opaque; |
void *opaque; |
71 |
}; |
}; |
72 |
typedef struct keyedit_callback_s KEYEDIT_CB; |
typedef struct keyedit_callback_s KEYEDIT_CB; |
73 |
|
|
74 |
struct keygen_callback_s { |
struct keygen_callback_s { |
75 |
int bits; |
int bits; |
76 |
int algo; |
int algo; |
77 |
u32 expire; |
u32 expire; |
78 |
char * fpr; |
char *fpr; |
79 |
}; |
}; |
80 |
typedef struct keygen_callback_s KEYGEN_CB; |
typedef struct keygen_callback_s KEYGEN_CB; |
81 |
|
|
83 |
static subclass_s keyedit_subkey_proc; |
static subclass_s keyedit_subkey_proc; |
84 |
static subclass_s keyedit_uid_proc; |
static subclass_s keyedit_uid_proc; |
85 |
|
|
86 |
int keygen_check_date( SYSTEMTIME * st ); |
int keygen_check_date (SYSTEMTIME *st); |
87 |
void get_userid_preflist (char ** r_prefs, int * r_flags); |
void get_userid_preflist (char **r_prefs, int * r_flags); |
88 |
|
|
89 |
static void |
static void |
90 |
do_init_keylist (HWND dlg, winpt_key_t k) |
do_init_keylist (HWND dlg, winpt_key_t k) |
803 |
if( get_pubkey( keyid, &key ) ) |
if( get_pubkey( keyid, &key ) ) |
804 |
BUG( NULL ); |
BUG( NULL ); |
805 |
sym_prefs = gpgme_key_get_string_attr( key, GPGME_ATTR_KEY_SYMPREFS, NULL, 0 ); |
sym_prefs = gpgme_key_get_string_attr( key, GPGME_ATTR_KEY_SYMPREFS, NULL, 0 ); |
806 |
if( !sym_prefs ) |
if (!sym_prefs) |
807 |
return 1; /* assume that only v3 keys have no symmetric cipher preferences |
return 1; /* assume that only v3 keys have no symmetric cipher preferences |
808 |
and thus IDEA is explicit. */ |
and thus IDEA is explicit. */ |
809 |
for( n = 0; sym_prefs[n]; n++ ) |
for( n = 0; sym_prefs[n]; n++ ) |
995 |
int nuids = 0, rc, j, u_attr; |
int nuids = 0, rc, j, u_attr; |
996 |
struct listview_column_s cols[] = { |
struct listview_column_s cols[] = { |
997 |
{0, 72, (char *)_("Validity")}, |
{0, 72, (char *)_("Validity")}, |
998 |
{1, 180, (char *)_("Name")}, |
{1, 150, (char *)_("Name")}, |
999 |
{2, 90, (char *)_("Email")}, |
{2, 110, (char *)_("Email")}, |
1000 |
{3, 76, (char *)_("Creation")}, |
{3, 76, (char *)_("Creation")}, |
1001 |
{0, 0, 0} |
{0, 0, 0} |
1002 |
}; |
}; |
1487 |
static int |
static int |
1488 |
parse_preflist (HWND dlg, const char *list) |
parse_preflist (HWND dlg, const char *list) |
1489 |
{ |
{ |
1490 |
char *p; |
char *p, buf[128] = {0}, *pbuf = buf; |
1491 |
const char *ciphers[11] = {0, "IDEA", "3DES", "CAST5", "BLOWFISH", 0, 0, "AES", "AES192", "AES256", "TWOFISH"}; |
const char *ciphers[11] = {0, "IDEA", "3DES", "CAST5", "BLOWFISH", 0, 0, "AES", "AES192", "AES256", "TWOFISH"}; |
1492 |
const char *hash[4] = {0, "MD5", "SHA1", "RMD160"}; |
const char *hash[11] = {0, "MD5", "SHA1", "RMD160", 0, 0, 0, 0, "SHA256", "SHA384", "SHA512"}; |
1493 |
const char *compress[4] = {0, "ZIP", "ZLIB", "BZIP2"}; |
const char *compress[4] = {0, "ZIP", "ZLIB", "BZIP2"}; |
1494 |
int n=0; |
int n=0; |
1495 |
|
|
1496 |
p = strtok ((char*)list, " "); |
strncpy (buf, list, 127); |
1497 |
|
p = strtok (pbuf, " "); |
1498 |
while (p != NULL) { |
while (p != NULL) { |
1499 |
int algid = atol (p+1); |
int algid = atol (p+1); |
1500 |
n++; |
n++; |
1504 |
break; |
break; |
1505 |
|
|
1506 |
case 'H': |
case 'H': |
1507 |
SendDlgItemMessage (dlg, IDC_SHOWPREF_HASH, LB_ADDSTRING, 0, (LPARAM)(const char*)hash[algid % 4]); |
SendDlgItemMessage (dlg, IDC_SHOWPREF_HASH, LB_ADDSTRING, 0, (LPARAM)(const char*)hash[algid % 10]); |
1508 |
break; |
break; |
1509 |
|
|
1510 |
case 'Z': |
case 'Z': |
1764 |
return FALSE; |
return FALSE; |
1765 |
} |
} |
1766 |
idxsub = listview_get_curr_pos( lvsub ); |
idxsub = listview_get_curr_pos( lvsub ); |
1767 |
if( km_key_is_v3( lvsub, idxsub==-1? 0 : idxsub ) && is_cmd_openpgp( cmd ) ) { |
if (k->is_v3 && is_cmd_openpgp (cmd)) { |
1768 |
msg_box( dlg, _("This command cannot be used with PGP 2 (v3) keys\n" |
msg_box (dlg, _("This command cannot be used with PGP 2 (v3) keys.\n"), |
1769 |
" because it is not OpenPGP compliant."), |
_("Key Edit"), MB_ERR); |
|
_("Key Edit"), MB_ERR ); |
|
1770 |
return FALSE; |
return FALSE; |
1771 |
} |
} |
1772 |
switch( cmd ) { |
switch (cmd) { |
1773 |
case CMD_SHOWPREF: do_editkey_showpref (k, dlg, lvuid); break; |
case CMD_SHOWPREF: do_editkey_showpref (k, dlg, lvuid); break; |
1774 |
case CMD_DELKEY: do_editkey_delkey (k, dlg, lvsub); break; |
case CMD_DELKEY: do_editkey_delkey (k, dlg, lvsub); break; |
1775 |
case CMD_ADDKEY: keyedit_add_subkey (k, dlg, lvsub); break; |
case CMD_ADDKEY: keyedit_add_subkey (k, dlg, lvsub); break; |
1790 |
|
|
1791 |
case IDCANCEL: |
case IDCANCEL: |
1792 |
if (k->update) |
if (k->update) |
1793 |
keycache_update (k->keyid); |
keycache_update (0, k->keyid); |
1794 |
EndDialog (dlg, FALSE); |
EndDialog (dlg, FALSE); |
1795 |
break; |
break; |
1796 |
|
|