mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 19:42:48 -05:00
winpgnt: add GUI button to re-encrypt an SSH-2 key.
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#define IDC_KEYLIST_LISTBOX 100
|
||||
#define IDC_KEYLIST_ADDKEY 101
|
||||
#define IDC_KEYLIST_ADDKEY_ENC 110
|
||||
#define IDC_KEYLIST_REENCRYPT 106
|
||||
#define IDC_KEYLIST_REMOVE 102
|
||||
#define IDC_KEYLIST_HELP 103
|
||||
#define IDC_KEYLIST_FPTYPE_STATIC 104
|
||||
|
@ -43,18 +43,19 @@ BEGIN
|
||||
PUSHBUTTON "&Cancel", IDCANCEL, 135, 52, 40, 14
|
||||
END
|
||||
|
||||
IDD_KEYLIST DIALOG DISCARDABLE 0, 0, 450, 211
|
||||
IDD_KEYLIST DIALOG DISCARDABLE 0, 0, 450, 236
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Pageant Key List"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LISTBOX 100, 10, 10, 420, 155,
|
||||
LBS_EXTENDEDSEL | LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "&Add Key", IDC_KEYLIST_ADDKEY, 75, 187, 60, 14
|
||||
PUSHBUTTON "Add Key (&encrypted)", IDC_KEYLIST_ADDKEY_ENC, 150, 187, 100, 14
|
||||
PUSHBUTTON "&Remove Key", IDC_KEYLIST_REMOVE, 315, 187, 60, 14
|
||||
PUSHBUTTON "&Help", IDC_KEYLIST_HELP, 10, 187, 50, 14
|
||||
DEFPUSHBUTTON "&Close", IDOK, 390, 187, 50, 14
|
||||
PUSHBUTTON "&Add Key", IDC_KEYLIST_ADDKEY, 10, 187, 60, 14
|
||||
PUSHBUTTON "Add Key (&encrypted)", IDC_KEYLIST_ADDKEY_ENC, 75, 187, 80, 14
|
||||
PUSHBUTTON "Re-e&ncrypt", IDC_KEYLIST_REENCRYPT, 315, 187, 60, 14
|
||||
PUSHBUTTON "&Remove", IDC_KEYLIST_REMOVE, 380, 187, 60, 14
|
||||
PUSHBUTTON "&Help", IDC_KEYLIST_HELP, 10, 212, 50, 14
|
||||
DEFPUSHBUTTON "&Close", IDOK, 390, 212, 50, 14
|
||||
LTEXT "&Fingerprint type:", IDC_KEYLIST_FPTYPE_STATIC, 10, 172, 60, 8
|
||||
COMBOBOX IDC_KEYLIST_FPTYPE, 70, 170, 60, 12, CBS_DROPDOWNLIST
|
||||
END
|
||||
|
@ -582,6 +582,7 @@ static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
|
||||
}
|
||||
return 0;
|
||||
case IDC_KEYLIST_REMOVE:
|
||||
case IDC_KEYLIST_REENCRYPT:
|
||||
if (HIWORD(wParam) == BN_CLICKED ||
|
||||
HIWORD(wParam) == BN_DOUBLECLICKED) {
|
||||
int i;
|
||||
@ -617,7 +618,14 @@ static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
|
||||
*/
|
||||
for (i = sCount - 1; (itemNum >= 0) && (i >= 0); i--) {
|
||||
if (selectedArray[itemNum] == rCount + i) {
|
||||
pageant_delete_nth_ssh2_key(i);
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDC_KEYLIST_REMOVE:
|
||||
pageant_delete_nth_ssh2_key(i);
|
||||
break;
|
||||
case IDC_KEYLIST_REENCRYPT:
|
||||
pageant_reencrypt_nth_ssh2_key(i);
|
||||
break;
|
||||
}
|
||||
itemNum--;
|
||||
}
|
||||
}
|
||||
@ -625,7 +633,14 @@ static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
|
||||
/* do the same for the rsa keys */
|
||||
for (i = rCount - 1; (itemNum >= 0) && (i >= 0); i--) {
|
||||
if(selectedArray[itemNum] == i) {
|
||||
pageant_delete_nth_ssh1_key(i);
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDC_KEYLIST_REMOVE:
|
||||
pageant_delete_nth_ssh1_key(i);
|
||||
break;
|
||||
case IDC_KEYLIST_REENCRYPT:
|
||||
/* SSH-1 keys can't be re-encrypted */
|
||||
break;
|
||||
}
|
||||
itemNum--;
|
||||
}
|
||||
}
|
||||
@ -660,6 +675,7 @@ static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
|
||||
case IDC_KEYLIST_ADDKEY: topic = WINHELP_CTX_pageant_addkey; break;
|
||||
case IDC_KEYLIST_REMOVE: topic = WINHELP_CTX_pageant_remkey; break;
|
||||
case IDC_KEYLIST_ADDKEY_ENC:
|
||||
case IDC_KEYLIST_REENCRYPT:
|
||||
topic = WINHELP_CTX_pageant_deferred; break;
|
||||
}
|
||||
if (topic) {
|
||||
|
Reference in New Issue
Block a user