svnno****@sourc*****
svnno****@sourc*****
2014年 3月 16日 (日) 21:13:24 JST
Revision: 5543 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5543 Author: yutakapon Date: 2014-03-16 21:13:24 +0900 (Sun, 16 Mar 2014) Log Message: ----------- Key Generator ダイアログで、SSH2 RSA/DSA/ECDSAの場合、 bcrypt KDF形式を選択できるようにした。 Modified Paths: -------------- branches/ssh_ed25519/installer/release/lang/English.lng branches/ssh_ed25519/installer/release/lang/French.lng branches/ssh_ed25519/installer/release/lang/German.lng branches/ssh_ed25519/installer/release/lang/Japanese.lng branches/ssh_ed25519/installer/release/lang/Korean.lng branches/ssh_ed25519/installer/release/lang/Russian.lng branches/ssh_ed25519/installer/release/lang/Simplified Chinese.lng branches/ssh_ed25519/ttssh2/ttxssh/resource.h branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.rc -------------- next part -------------- Modified: branches/ssh_ed25519/installer/release/lang/English.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/English.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/English.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -634,6 +634,7 @@ DLG_KEYGEN_SAVEPRIVATE=Save &private key DLG_KEYGEN_GENERATE=&Generate DLG_KEYGEN_BITS=Key &Bits: +DLG_BCRYPT_KDF=bcrypt &KDF format MSG_KEYBITS_MIN_ERROR=The key bits is too small. MSG_KEYGEN_GENERATING="generating key" Modified: branches/ssh_ed25519/installer/release/lang/French.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/French.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/French.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -634,6 +634,7 @@ DLG_KEYGEN_SAVEPRIVATE=Sauv. cl\xE9 priv\xE9e DLG_KEYGEN_GENERATE=&G\xE9n\xE9rer DLG_KEYGEN_BITS=Nbre &Bits: +DLG_BCRYPT_KDF=bcrypt &KDF format MSG_KEYBITS_MIN_ERROR=Nbre de bits trop petit. MSG_KEYGEN_GENERATING="g\xE9n\xE9ration cl\xE9" Modified: branches/ssh_ed25519/installer/release/lang/German.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/German.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/German.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -632,6 +632,7 @@ DLG_KEYGEN_SAVEPRIVATE=Private Key DLG_KEYGEN_GENERATE=Generieren DLG_KEYGEN_BITS=Key &Bits: +DLG_BCRYPT_KDF=bcrypt &KDF format MSG_KEYBITS_MIN_ERROR=The key bits is too small. MSG_KEYGEN_GENERATING="generating key" Modified: branches/ssh_ed25519/installer/release/lang/Japanese.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/Japanese.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/Japanese.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -633,6 +633,7 @@ DLG_KEYGEN_SAVEPRIVATE=\x94閧\x8C\xAE\x82̕ۑ\xB6(&P) DLG_KEYGEN_GENERATE=\x90\xB6\x90\xAC(&G) DLG_KEYGEN_BITS=\x83r\x83b\x83g\x90\x94(&B): +DLG_BCRYPT_KDF=bcrypt KDF\x8C`\x8E\xAE(&K) MSG_KEYBITS_MIN_ERROR=\x8C\xAE\x82̃r\x83b\x83g\x90\x94\x82\xAA\x8F\xAC\x82\xB3\x82\xB7\x82\xAC\x82܂\xB7. MSG_KEYGEN_GENERATING=\x8C\xAE\x82\xAC\x82\xB5\x82Ă\xA2\x82܂\xB7\x81B Modified: branches/ssh_ed25519/installer/release/lang/Korean.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/Korean.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/Korean.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -635,6 +635,7 @@ DLG_KEYGEN_SAVEPRIVATE=\xB0\xB3\xC0\xCEŰ \xC0\xFA\xC0\xE5(&P) DLG_KEYGEN_GENERATE=\xBB\xFD\xBC\xBA(&G) DLG_KEYGEN_BITS=Ű\xBA\xF1Ʈ(&B): +DLG_BCRYPT_KDF=bcrypt &KDF format MSG_KEYBITS_MIN_ERROR=Ű \xBA\xF1Ʈ\xB0\xA1 \xB3ʹ\xAB \xC0۽\xC0\xB4ϴ\xD9. MSG_KEYGEN_GENERATING="Ű \xBB\xFD\xBC\xBA \xC1\xDF" Modified: branches/ssh_ed25519/installer/release/lang/Russian.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/Russian.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/Russian.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -634,6 +634,7 @@ DLG_KEYGEN_SAVEPRIVATE=&\xC7\xE0\xEA\xF0\xFB\xF2\xFB\xE9 \xEA\xEB\xFE\xF7 DLG_KEYGEN_GENERATE=&\xC3\xE5\xED\xE5\xF0\xE0\xF6\xE8\xFF DLG_KEYGEN_BITS=&\xC1\xE8\xF2\xFB: +DLG_BCRYPT_KDF=bcrypt &KDF format MSG_KEYBITS_MIN_ERROR=\xC1\xE8\xF2\xEE\xE2 \xEA\xEB\xFE\xF7\xE0 \xF1\xEB\xE8\xF8\xEA\xEE\xEC \xEC\xE0\xEB\xEE! MSG_KEYGEN_GENERATING="\xC3\xE5\xED\xE5\xF0\xE0\xF6\xE8\xFF \xEA\xEB\xFE\xF7\xE0..." Modified: branches/ssh_ed25519/installer/release/lang/Simplified Chinese.lng =================================================================== --- branches/ssh_ed25519/installer/release/lang/Simplified Chinese.lng 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/installer/release/lang/Simplified Chinese.lng 2014-03-16 12:13:24 UTC (rev 5543) @@ -634,6 +634,7 @@ DLG_KEYGEN_SAVEPRIVATE=\xB1\xA3\xB4\xE6Ϊ˽\xD3\xD0\xC3\xDCԿ(&P) DLG_KEYGEN_GENERATE=\xC9\xFA\xB3\xC9(&G) DLG_KEYGEN_BITS=\xC3\xDCԿ\xD7ֽ\xDA\xCA\xFD(&B)\xA3\xBA +DLG_BCRYPT_KDF=bcrypt &KDF format MSG_KEYBITS_MIN_ERROR=\xC3\xDCԿ\xD7ֽ\xDA\xCA\xFD̫С MSG_KEYGEN_GENERATING=\xD5\xFD\xD4\xDA\xC9\xFA\xB3\xC9\xC3\xDCԿ Modified: branches/ssh_ed25519/ttssh2/ttxssh/resource.h =================================================================== --- branches/ssh_ed25519/ttssh2/ttxssh/resource.h 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/ttssh2/ttxssh/resource.h 2014-03-16 12:13:24 UTC (rev 5543) @@ -95,6 +95,7 @@ #define IDC_CHECKAUTH 1055 #define IDC_CHECKIDENTITY 1055 #define IDC_FORWARDAGENT 1055 +#define IDC_BCRYPT_KDF_CHECK 1055 #define IDC_TTSSH_VERSION 1056 #define IDC_FORWARD_AGENT 1056 #define IDC_FORWARDAGENTCONFIRM 1056 @@ -199,7 +200,6 @@ #define IDC_SENDFILE_TO 1208 #define IDC_SFTP_CONSOLE 1208 #define IDC_PUTTY_VERSION 1209 -#define IDC_RADIO2 1211 #define IDC_ED25519_TYPE 1211 // Next default values for new objects Modified: branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c =================================================================== --- branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c 2014-03-16 12:13:24 UTC (rev 5543) @@ -4270,6 +4270,9 @@ GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg)); UTIL_get_lang_msg("BTN_CANCEL", pvar, uimsg); SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg); + GetDlgItemText(dlg, IDC_BCRYPT_KDF_CHECK, uimsg, sizeof(uimsg)); + UTIL_get_lang_msg("DLG_BCRYPT_KDF", pvar, uimsg); + SetDlgItemText(dlg, IDC_BCRYPT_KDF_CHECK, pvar->ts->UIMsg); font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); GetObject(font, sizeof(LOGFONT), &logfont); @@ -4295,6 +4298,7 @@ SendDlgItemMessage(dlg, IDC_SAVE_PRIVATE_KEY, WM_SETFONT, (WPARAM)DlgKeygenFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgKeygenFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgKeygenFont, MAKELPARAM(TRUE,0)); + SendDlgItemMessage(dlg, IDC_BCRYPT_KDF_CHECK, WM_SETFONT, (WPARAM)DlgKeygenFont, MAKELPARAM(TRUE,0)); } else { DlgHostFont = NULL; @@ -4323,6 +4327,9 @@ EnableWindow(GetDlgItem(dlg, IDC_SAVE_PUBLIC_KEY), FALSE); EnableWindow(GetDlgItem(dlg, IDC_SAVE_PRIBATE_KEY), FALSE); + // default bcrypt KDF + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); + } return TRUE; @@ -4446,6 +4453,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), TRUE); SetDlgItemInt(dlg, IDC_KEYBITS, saved_key_bits, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), FALSE); key_type = KEY_RSA1; break; @@ -4454,6 +4462,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), TRUE); SetDlgItemInt(dlg, IDC_KEYBITS, saved_key_bits, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); key_type = KEY_RSA; break; @@ -4462,6 +4471,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); key_type = KEY_DSA; SetDlgItemInt(dlg, IDC_KEYBITS, 1024, FALSE); break; @@ -4471,6 +4481,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); key_type = KEY_ECDSA256; SetDlgItemInt(dlg, IDC_KEYBITS, 256, FALSE); break; @@ -4480,6 +4491,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); key_type = KEY_ECDSA384; SetDlgItemInt(dlg, IDC_KEYBITS, 384, FALSE); break; @@ -4489,6 +4501,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); key_type = KEY_ECDSA521; SetDlgItemInt(dlg, IDC_KEYBITS, 521, FALSE); break; @@ -4499,6 +4512,7 @@ EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } + EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), FALSE); key_type = KEY_ED25519; SetDlgItemInt(dlg, IDC_KEYBITS, 0, FALSE); break; @@ -4887,14 +4901,16 @@ } else if (private_key.type == KEY_ED25519) { // SSH2 ED25519 save_bcrypt_private_key(buf, filename, comment, dlg, pvar); - } else { // SSH2 RSA, DSA, ECDSA -#if 0 - save_bcrypt_private_key(buf, filename, comment, dlg, pvar); -#else + } else { // SSH2 RSA, DSA, ECDSA int len; FILE *fp; const EVP_CIPHER *cipher; + if (SendMessage(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED) { + save_bcrypt_private_key(buf, filename, comment, dlg, pvar); + break; + } + len = strlen(buf); // TODO: range check (len >= 4) @@ -4934,7 +4950,6 @@ MessageBox(dlg, uimsg, pvar->ts->UIMsg, MB_OK | MB_ICONEXCLAMATION); } fclose(fp); -#endif } Modified: branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.rc =================================================================== --- branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.rc 2014-03-16 11:26:30 UTC (rev 5542) +++ branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.rc 2014-03-16 12:13:24 UTC (rev 5543) @@ -332,7 +332,7 @@ LTEXT "",IDC_SSHAUTHBANNER2,6,16,203,48 END -IDD_SSHKEYGEN DIALOGEX 0, 0, 256, 139 +IDD_SSHKEYGEN DIALOGEX 0, 0, 256, 153 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "TTSSH: Key Generator" FONT 8, "Tahoma", 0, 0, 0x0 @@ -346,18 +346,19 @@ CONTROL "ECDSA-&256",IDC_ECDSA256_TYPE,"Button",BS_AUTORADIOBUTTON,17,29,55,10 CONTROL "ECDSA-&384",IDC_ECDSA384_TYPE,"Button",BS_AUTORADIOBUTTON,80,29,55,10 CONTROL "ECDSA-&521",IDC_ECDSA521_TYPE,"Button",BS_AUTORADIOBUTTON,17,41,55,10 + CONTROL "ED25519",IDC_ED25519_TYPE,"Button",BS_AUTORADIOBUTTON,80,42,45,10 + CONTROL "bcrypt KDF format",IDC_BCRYPT_KDF_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,58,75,10 RTEXT "Key &Bits:",IDC_KEYBITS_LABEL,143,14,40,10,NOT WS_GROUP EDITTEXT IDC_KEYBITS,155,26,25,12,ES_AUTOHSCROLL | ES_NUMBER | WS_GROUP - LTEXT "",IDC_KEYGEN_PROGRESS_LABEL,40,56,172,8 - RTEXT "Key passphrase:",IDC_KEY_LABEL,14,71,80,8 - RTEXT "Confirm passphrase:",IDC_CONFIRM_LABEL,14,86,80,8 - EDITTEXT IDC_KEY_EDIT,100,69,108,12,ES_PASSWORD | ES_AUTOHSCROLL - EDITTEXT IDC_CONFIRM_EDIT,100,85,108,12,ES_PASSWORD | ES_AUTOHSCROLL - RTEXT "C&omment:",IDC_COMMENT_LABEL,14,101,80,8 - EDITTEXT IDC_COMMENT_EDIT,100,100,108,12,ES_AUTOHSCROLL - PUSHBUTTON "Save publi&c key",IDC_SAVE_PUBLIC_KEY,49,118,68,14 - PUSHBUTTON "Save &private key",IDC_SAVE_PRIVATE_KEY,133,118,68,14 - CONTROL "ED25519",IDC_ED25519_TYPE,"Button",BS_AUTORADIOBUTTON,80,42,45,10 + LTEXT "",IDC_KEYGEN_PROGRESS_LABEL,40,74,172,8 + RTEXT "Key passphrase:",IDC_KEY_LABEL,14,89,80,8 + EDITTEXT IDC_KEY_EDIT,100,87,108,12,ES_PASSWORD | ES_AUTOHSCROLL + RTEXT "Confirm passphrase:",IDC_CONFIRM_LABEL,14,104,80,8 + EDITTEXT IDC_CONFIRM_EDIT,100,103,108,12,ES_PASSWORD | ES_AUTOHSCROLL + RTEXT "C&omment:",IDC_COMMENT_LABEL,14,119,80,8 + EDITTEXT IDC_COMMENT_EDIT,100,118,108,12,ES_AUTOHSCROLL + PUSHBUTTON "Save publi&c key",IDC_SAVE_PUBLIC_KEY,49,136,68,14 + PUSHBUTTON "Save &private key",IDC_SAVE_PRIVATE_KEY,133,136,68,14 END IDD_SSHSCP DIALOGEX 0, 0, 279, 125 @@ -524,7 +525,7 @@ LEFTMARGIN, 7 RIGHTMARGIN, 249 TOPMARGIN, 7 - BOTTOMMARGIN, 117 + BOTTOMMARGIN, 131 END IDD_SSHSCP, DIALOG