Loweynet
修訂 | 8cdba6986cfab763ef8a267a092bc4f94b316974 (tree) |
---|---|
時間 | 2017-12-03 20:30:48 |
作者 | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Change UI of SSL certificate confirmation dialog.
@@ -1496,6 +1496,17 @@ BEGIN | ||
1496 | 1496 | PUSHBUTTON "³",IDIGNORE,173,42,50,14 |
1497 | 1497 | END |
1498 | 1498 | |
1499 | +ssl_confirm_dlg DIALOGEX 0, 0, 360, 222 | |
1500 | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | |
1501 | +CAPTION "ؾÌmF" | |
1502 | +FONT 9, "MS Shell Dlg", 0, 0, 0x0 | |
1503 | +BEGIN | |
1504 | + LTEXT "±ÌؾðMµAÊMð±s·éÉÍuOKvðIðµÄ¾³¢B",-1,7,7,345,10 | |
1505 | + EDITTEXT COMMON_TEXT,7,21,345,170,ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_HSCROLL | |
1506 | + PUSHBUTTON "OK",IDOK,127,197,50,14 | |
1507 | + PUSHBUTTON "LZ",IDCANCEL,182,197,50,14 | |
1508 | +END | |
1509 | + | |
1499 | 1510 | |
1500 | 1511 | ///////////////////////////////////////////////////////////////////////////// |
1501 | 1512 | // |
@@ -1510,7 +1521,6 @@ BEGIN | ||
1510 | 1521 | LEFTMARGIN, 7 |
1511 | 1522 | RIGHTMARGIN, 312 |
1512 | 1523 | TOPMARGIN, 4 |
1513 | - BOTTOMMARGIN, 308 | |
1514 | 1524 | END |
1515 | 1525 | |
1516 | 1526 | transfer_dlg, DIALOG |
@@ -2191,6 +2201,14 @@ BEGIN | ||
2191 | 2201 | TOPMARGIN, 7 |
2192 | 2202 | BOTTOMMARGIN, 57 |
2193 | 2203 | END |
2204 | + | |
2205 | + ssl_confirm_dlg, DIALOG | |
2206 | + BEGIN | |
2207 | + LEFTMARGIN, 7 | |
2208 | + RIGHTMARGIN, 353 | |
2209 | + TOPMARGIN, 7 | |
2210 | + BOTTOMMARGIN, 215 | |
2211 | + END | |
2194 | 2212 | END |
2195 | 2213 | #endif // APSTUDIO_INVOKED |
2196 | 2214 |
@@ -119,6 +119,7 @@ | ||
119 | 119 | #define opt_disp2_dlg 196 |
120 | 120 | #define opt_updates_dlg 197 |
121 | 121 | #define corruptsettings_dlg 198 |
122 | +#define ssl_confirm_dlg 199 | |
122 | 123 | #define TRANS_TIME_BAR 1002 |
123 | 124 | #define TRANS_TEXT 1003 |
124 | 125 | #define TRANS_REMOTE 1003 |
@@ -664,7 +665,7 @@ | ||
664 | 665 | // |
665 | 666 | #ifdef APSTUDIO_INVOKED |
666 | 667 | #ifndef APSTUDIO_READONLY_SYMBOLS |
667 | -#define _APS_NEXT_RESOURCE_VALUE 199 | |
668 | +#define _APS_NEXT_RESOURCE_VALUE 200 | |
668 | 669 | #define _APS_NEXT_COMMAND_VALUE 40183 |
669 | 670 | #define _APS_NEXT_CONTROL_VALUE 1231 |
670 | 671 | #define _APS_NEXT_SYMED_VALUE 101 |
@@ -1540,6 +1540,17 @@ BEGIN | ||
1540 | 1540 | PUSHBUTTON "Ignore",IDIGNORE,173,42,50,14 |
1541 | 1541 | END |
1542 | 1542 | |
1543 | +ssl_confirm_dlg DIALOGEX 0, 0, 360, 222 | |
1544 | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | |
1545 | +CAPTION "Confirmation of certificate" | |
1546 | +FONT 9, "MS Shell Dlg", 0, 0, 0x0 | |
1547 | +BEGIN | |
1548 | + LTEXT "Choose 'OK' if you trust this certificate and continue.",-1,7,7,345,10 | |
1549 | + EDITTEXT COMMON_TEXT,7,21,345,170,ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_HSCROLL | |
1550 | + PUSHBUTTON "OK",IDOK,127,197,50,14 | |
1551 | + PUSHBUTTON "Cancel",IDCANCEL,182,197,50,14 | |
1552 | +END | |
1553 | + | |
1543 | 1554 | |
1544 | 1555 | ///////////////////////////////////////////////////////////////////////////// |
1545 | 1556 | // |
@@ -2232,6 +2243,14 @@ BEGIN | ||
2232 | 2243 | TOPMARGIN, 7 |
2233 | 2244 | BOTTOMMARGIN, 57 |
2234 | 2245 | END |
2246 | + | |
2247 | + ssl_confirm_dlg, DIALOG | |
2248 | + BEGIN | |
2249 | + LEFTMARGIN, 7 | |
2250 | + RIGHTMARGIN, 353 | |
2251 | + TOPMARGIN, 7 | |
2252 | + BOTTOMMARGIN, 215 | |
2253 | + END | |
2235 | 2254 | END |
2236 | 2255 | #endif // APSTUDIO_INVOKED |
2237 | 2256 |
@@ -119,6 +119,7 @@ | ||
119 | 119 | #define opt_disp2_dlg 196 |
120 | 120 | #define opt_updates_dlg 197 |
121 | 121 | #define corruptsettings_dlg 198 |
122 | +#define ssl_confirm_dlg 199 | |
122 | 123 | #define TRANS_TIME_BAR 1002 |
123 | 124 | #define TRANS_TEXT 1003 |
124 | 125 | #define TRANS_REMOTE 1003 |
@@ -664,7 +665,7 @@ | ||
664 | 665 | // |
665 | 666 | #ifdef APSTUDIO_INVOKED |
666 | 667 | #ifndef APSTUDIO_READONLY_SYMBOLS |
667 | -#define _APS_NEXT_RESOURCE_VALUE 199 | |
668 | +#define _APS_NEXT_RESOURCE_VALUE 200 | |
668 | 669 | #define _APS_NEXT_COMMAND_VALUE 40183 |
669 | 670 | #define _APS_NEXT_CONTROL_VALUE 1231 |
670 | 671 | #define _APS_NEXT_SYMED_VALUE 101 |
@@ -1975,6 +1975,8 @@ int CalcPixelY(int y); | ||
1975 | 1975 | HBITMAP ResizeBitmap(HBITMAP hBitmap, int UnitSizeX, int UnitSizeY, int ScaleNumerator, int ScaleDenominator); |
1976 | 1976 | // ソフトウェア自動更新 |
1977 | 1977 | void DecodeLineFeed(char* Str); |
1978 | +// 暗号化通信対応 | |
1979 | +int ReplaceAllStrings(char* Out, char* In, char* From, char* To); | |
1978 | 1980 | |
1979 | 1981 | /*===== dlgsize.c =====*/ |
1980 | 1982 |
@@ -3579,6 +3579,7 @@ BOOL __stdcall SSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certif | ||
3579 | 3579 | uint32 Hash[5]; |
3580 | 3580 | int i; |
3581 | 3581 | char* pm0; |
3582 | + char* pm1; | |
3582 | 3583 | bResult = FALSE; |
3583 | 3584 | sha_memory((char*)Certificate, (uint32)(strlen(Certificate) * sizeof(char)), (uint32*)&Hash); |
3584 | 3585 | // sha.cはビッグエンディアンのため |
@@ -3598,13 +3599,18 @@ BOOL __stdcall SSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certif | ||
3598 | 3599 | { |
3599 | 3600 | if(pm0 = AllocateStringM(strlen(Certificate) + 1024)) |
3600 | 3601 | { |
3601 | - sprintf(pm0, MSGJPN326, IsHostNameMatched(AskHostAdrs(), CommonName) ? MSGJPN327 : MSGJPN328, bVerified ? MSGJPN327 : MSGJPN328, Certificate); | |
3602 | - if(MessageBox(GetMainHwnd(), pm0, "FFFTP", MB_YESNO) == IDYES) | |
3602 | + if(pm1 = AllocateStringM(strlen(Certificate) * 2 + 1024)) | |
3603 | 3603 | { |
3604 | - for(i = MAX_CERT_CACHE_HASH - 1; i >= 1; i--) | |
3605 | - memcpy(&CertificateCacheHash[i], &CertificateCacheHash[i - 1], 20); | |
3606 | - memcpy(&CertificateCacheHash[0], &Hash, 20); | |
3607 | - bResult = TRUE; | |
3604 | + sprintf(pm0, MSGJPN326, IsHostNameMatched(AskHostAdrs(), CommonName) ? MSGJPN327 : MSGJPN328, bVerified ? MSGJPN327 : MSGJPN328, Certificate); | |
3605 | + ReplaceAllStrings(pm1, pm0, "\n", "\r\n"); | |
3606 | + if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(ssl_confirm_dlg), GetMainHwnd(), ExeEscTextDialogProc, (LPARAM)pm1) == YES) | |
3607 | + { | |
3608 | + for(i = MAX_CERT_CACHE_HASH - 1; i >= 1; i--) | |
3609 | + memcpy(&CertificateCacheHash[i], &CertificateCacheHash[i - 1], 20); | |
3610 | + memcpy(&CertificateCacheHash[0], &Hash, 20); | |
3611 | + bResult = TRUE; | |
3612 | + } | |
3613 | + FreeDuplicatedString(pm1); | |
3608 | 3614 | } |
3609 | 3615 | FreeDuplicatedString(pm0); |
3610 | 3616 | } |
@@ -324,7 +324,7 @@ | ||
324 | 324 | #define MSGJPN323 _Tu8("Failed to unload untrustworthy DLLs.", "Failed to unload untrustworthy DLLs.") |
325 | 325 | #define MSGJPN324 _Tu8("Failed to hook required functions to protect the process.", "Failed to hook required functions to protect the process.") |
326 | 326 | #define MSGJPN325 _Tu8("New master passwords are not identical.", "New master passwords are not identical.") |
327 | -#define MSGJPN326 _Tu8("Choose 'Yes' if you trust this certificate and continue.\r\nCN is identical: %s\r\nVerified successfully: %s\r\n\r\n%s", "Choose 'Yes' if you trust this certificate and continue.\r\nCN is identical: %s\r\nVerified successfully: %s\r\n\r\n%s") | |
327 | +#define MSGJPN326 _Tu8("Summary\nCN is identical: %s\nVerified successfully: %s\n\nDetailed information\n%s", "Summary\nCN is identical: %s\nVerified successfully: %s\n\nDetailed information\n%s") | |
328 | 328 | #define MSGJPN327 _Tu8("Yes", "Yes") |
329 | 329 | #define MSGJPN328 _Tu8("No", "No") |
330 | 330 | #define MSGJPN329 _Tu8("UTF-8 BOM", "UTF-8 BOM") |
@@ -324,7 +324,7 @@ | ||
324 | 324 | #define MSGJPN323 _Tu8("信頼できないDLLをアンロードできませんでした.", "\xE4\xBF\xA1\xE9\xA0\xBC\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xAA\xE3\x81\x84\x44LL\xE3\x82\x92\xE3\x82\xA2\xE3\x83\xB3\xE3\x83\xAD\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93\xE3\x81\xA7\xE3\x81\x97\xE3\x81\x9F.") |
325 | 325 | #define MSGJPN324 _Tu8("プロセスの保護に必要な関数をフックできませんでした.", "\xE3\x83\x97\xE3\x83\xAD\xE3\x82\xBB\xE3\x82\xB9\xE3\x81\xAE\xE4\xBF\x9D\xE8\xAD\xB7\xE3\x81\xAB\xE5\xBF\x85\xE8\xA6\x81\xE3\x81\xAA\xE9\x96\xA2\xE6\x95\xB0\xE3\x82\x92\xE3\x83\x95\xE3\x83\x83\xE3\x82\xAF\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93\xE3\x81\xA7\xE3\x81\x97\xE3\x81\x9F.") |
326 | 326 | #define MSGJPN325 _Tu8("新しいマスターパスワードが一致しません.", "\xE6\x96\xB0\xE3\x81\x97\xE3\x81\x84\xE3\x83\x9E\xE3\x82\xB9\xE3\x82\xBF\xE3\x83\xBC\xE3\x83\x91\xE3\x82\xB9\xE3\x83\xAF\xE3\x83\xBC\xE3\x83\x89\xE3\x81\x8C\xE4\xB8\x80\xE8\x87\xB4\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93.") |
327 | -#define MSGJPN326 _Tu8("この証明書を信頼し,通信を続行するには「はい」を選択してください.\r\nCNの一致: %s\r\n検証に成功: %s\r\n\r\n%s", "\xE3\x81\x93\xE3\x81\xAE\xE8\xA8\xBC\xE6\x98\x8E\xE6\x9B\xB8\xE3\x82\x92\xE4\xBF\xA1\xE9\xA0\xBC\xE3\x81\x97,\xE9\x80\x9A\xE4\xBF\xA1\xE3\x82\x92\xE7\xB6\x9A\xE8\xA1\x8C\xE3\x81\x99\xE3\x82\x8B\xE3\x81\xAB\xE3\x81\xAF\xE3\x80\x8C\xE3\x81\xAF\xE3\x81\x84\xE3\x80\x8D\xE3\x82\x92\xE9\x81\xB8\xE6\x8A\x9E\xE3\x81\x97\xE3\x81\xA6\xE3\x81\x8F\xE3\x81\xA0\xE3\x81\x95\xE3\x81\x84.\r\nCN\xE3\x81\xAE\xE4\xB8\x80\xE8\x87\xB4: %s\r\n\xE6\xA4\x9C\xE8\xA8\xBC\xE3\x81\xAB\xE6\x88\x90\xE5\x8A\x9F: %s\r\n\r\n%s") | |
327 | +#define MSGJPN326 _Tu8("概要\nCNの一致: %s\n検証に成功: %s\n\n詳細情報\n%s", "\xE6\xA6\x82\xE8\xA6\x81\nCN\xE3\x81\xAE\xE4\xB8\x80\xE8\x87\xB4: %s\n\xE6\xA4\x9C\xE8\xA8\xBC\xE3\x81\xAB\xE6\x88\x90\xE5\x8A\x9F: %s\n\n\xE8\xA9\xB3\xE7\xB4\xB0\xE6\x83\x85\xE5\xA0\xB1\n%s") | |
328 | 328 | #define MSGJPN327 _Tu8("はい", "\xE3\x81\xAF\xE3\x81\x84") |
329 | 329 | #define MSGJPN328 _Tu8("いいえ", "\xE3\x81\x84\xE3\x81\x84\xE3\x81\x88") |
330 | 330 | #define MSGJPN329 _Tu8("UTF-8 BOM", "UTF-8 BOM") |
@@ -241,6 +241,11 @@ INT_PTR CALLBACK ExeEscTextDialogProc(HWND hDlg, UINT message, WPARAM wParam, LP | ||
241 | 241 | { |
242 | 242 | switch (message) |
243 | 243 | { |
244 | + // 暗号化通信対応 | |
245 | + case WM_SHOWWINDOW : | |
246 | + SendDlgItemMessage(hDlg, COMMON_TEXT, EM_SETSEL, 0, 0); | |
247 | + return(TRUE); | |
248 | + | |
244 | 249 | case WM_INITDIALOG : |
245 | 250 | SendDlgItemMessage(hDlg, COMMON_TEXT, WM_SETTEXT, 0, lParam); |
246 | 251 | return(TRUE); |
@@ -2074,3 +2079,42 @@ void DecodeLineFeed(char* Str) | ||
2074 | 2079 | } |
2075 | 2080 | } |
2076 | 2081 | |
2082 | +// 暗号化通信対応 | |
2083 | +int ReplaceAllStrings(char* Out, char* In, char* From, char* To) | |
2084 | +{ | |
2085 | + int InLen; | |
2086 | + int FromLen; | |
2087 | + int ToLen; | |
2088 | + int Count; | |
2089 | + char* p; | |
2090 | + int Len; | |
2091 | + InLen = strlen(In); | |
2092 | + FromLen = strlen(From); | |
2093 | + ToLen = strlen(To); | |
2094 | + Count = 0; | |
2095 | + if(Out) | |
2096 | + { | |
2097 | + while(p = strstr(In, From)) | |
2098 | + { | |
2099 | + Len = p - In; | |
2100 | + strncpy(Out, In, Len); | |
2101 | + Out += Len; | |
2102 | + In += Len; | |
2103 | + strncpy(Out, To, ToLen); | |
2104 | + Out += ToLen; | |
2105 | + In += FromLen; | |
2106 | + Count++; | |
2107 | + } | |
2108 | + *Out = '\0'; | |
2109 | + } | |
2110 | + else | |
2111 | + { | |
2112 | + while(In = strstr(In, From)) | |
2113 | + { | |
2114 | + In += FromLen; | |
2115 | + Count++; | |
2116 | + } | |
2117 | + } | |
2118 | + return InLen + (ToLen - FromLen) * Count; | |
2119 | +} | |
2120 | + |