• R/O
  • HTTP
  • SSH
  • HTTPS

ffftp: コミット

FFFTPのソースコードです。


コミットメタ情報

リビジョン8cdba6986cfab763ef8a267a092bc4f94b316974 (tree)
日時2017-12-03 20:30:48
作者s_kawamoto <s_kawamoto@user...>
コミッターs_kawamoto

ログメッセージ

Change UI of SSL certificate confirmation dialog.

変更サマリ

差分

Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
Binary files a/FFFTP_Eng_Release_64/FFFTP.exe and b/FFFTP_Eng_Release_64/FFFTP.exe differ
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
Binary files a/Release_64/FFFTP.exe and b/Release_64/FFFTP.exe differ
--- a/Resource/FFFTP.rc
+++ b/Resource/FFFTP.rc
@@ -1496,6 +1496,17 @@ BEGIN
14961496 PUSHBUTTON "無視",IDIGNORE,173,42,50,14
14971497 END
14981498
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 "証明書の確認"
1502+FONT 9, "MS Shell Dlg", 0, 0, 0x0
1503+BEGIN
1504+ LTEXT "この証明書を信頼し、通信を続行するには「OK」を選択してください。",-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 "キャンセル",IDCANCEL,182,197,50,14
1508+END
1509+
14991510
15001511 /////////////////////////////////////////////////////////////////////////////
15011512 //
@@ -1510,7 +1521,6 @@ BEGIN
15101521 LEFTMARGIN, 7
15111522 RIGHTMARGIN, 312
15121523 TOPMARGIN, 4
1513- BOTTOMMARGIN, 308
15141524 END
15151525
15161526 transfer_dlg, DIALOG
@@ -2191,6 +2201,14 @@ BEGIN
21912201 TOPMARGIN, 7
21922202 BOTTOMMARGIN, 57
21932203 END
2204+
2205+ ssl_confirm_dlg, DIALOG
2206+ BEGIN
2207+ LEFTMARGIN, 7
2208+ RIGHTMARGIN, 353
2209+ TOPMARGIN, 7
2210+ BOTTOMMARGIN, 215
2211+ END
21942212 END
21952213 #endif // APSTUDIO_INVOKED
21962214
--- a/Resource/resource.h
+++ b/Resource/resource.h
@@ -119,6 +119,7 @@
119119 #define opt_disp2_dlg 196
120120 #define opt_updates_dlg 197
121121 #define corruptsettings_dlg 198
122+#define ssl_confirm_dlg 199
122123 #define TRANS_TIME_BAR 1002
123124 #define TRANS_TEXT 1003
124125 #define TRANS_REMOTE 1003
@@ -664,7 +665,7 @@
664665 //
665666 #ifdef APSTUDIO_INVOKED
666667 #ifndef APSTUDIO_READONLY_SYMBOLS
667-#define _APS_NEXT_RESOURCE_VALUE 199
668+#define _APS_NEXT_RESOURCE_VALUE 200
668669 #define _APS_NEXT_COMMAND_VALUE 40183
669670 #define _APS_NEXT_CONTROL_VALUE 1231
670671 #define _APS_NEXT_SYMED_VALUE 101
--- a/Resource_eng/ffftp.rc
+++ b/Resource_eng/ffftp.rc
@@ -1540,6 +1540,17 @@ BEGIN
15401540 PUSHBUTTON "Ignore",IDIGNORE,173,42,50,14
15411541 END
15421542
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+
15431554
15441555 /////////////////////////////////////////////////////////////////////////////
15451556 //
@@ -2232,6 +2243,14 @@ BEGIN
22322243 TOPMARGIN, 7
22332244 BOTTOMMARGIN, 57
22342245 END
2246+
2247+ ssl_confirm_dlg, DIALOG
2248+ BEGIN
2249+ LEFTMARGIN, 7
2250+ RIGHTMARGIN, 353
2251+ TOPMARGIN, 7
2252+ BOTTOMMARGIN, 215
2253+ END
22352254 END
22362255 #endif // APSTUDIO_INVOKED
22372256
--- a/Resource_eng/resource.h
+++ b/Resource_eng/resource.h
@@ -119,6 +119,7 @@
119119 #define opt_disp2_dlg 196
120120 #define opt_updates_dlg 197
121121 #define corruptsettings_dlg 198
122+#define ssl_confirm_dlg 199
122123 #define TRANS_TIME_BAR 1002
123124 #define TRANS_TEXT 1003
124125 #define TRANS_REMOTE 1003
@@ -664,7 +665,7 @@
664665 //
665666 #ifdef APSTUDIO_INVOKED
666667 #ifndef APSTUDIO_READONLY_SYMBOLS
667-#define _APS_NEXT_RESOURCE_VALUE 199
668+#define _APS_NEXT_RESOURCE_VALUE 200
668669 #define _APS_NEXT_COMMAND_VALUE 40183
669670 #define _APS_NEXT_CONTROL_VALUE 1231
670671 #define _APS_NEXT_SYMED_VALUE 101
--- a/src/common.h
+++ b/src/common.h
@@ -1975,6 +1975,8 @@ int CalcPixelY(int y);
19751975 HBITMAP ResizeBitmap(HBITMAP hBitmap, int UnitSizeX, int UnitSizeY, int ScaleNumerator, int ScaleDenominator);
19761976 // ソフトウェア自動更新
19771977 void DecodeLineFeed(char* Str);
1978+// 暗号化通信対応
1979+int ReplaceAllStrings(char* Out, char* In, char* From, char* To);
19781980
19791981 /*===== dlgsize.c =====*/
19801982
--- a/src/main.c
+++ b/src/main.c
@@ -3579,6 +3579,7 @@ BOOL __stdcall SSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certif
35793579 uint32 Hash[5];
35803580 int i;
35813581 char* pm0;
3582+ char* pm1;
35823583 bResult = FALSE;
35833584 sha_memory((char*)Certificate, (uint32)(strlen(Certificate) * sizeof(char)), (uint32*)&Hash);
35843585 // sha.cはビッグエンディアンのため
@@ -3598,13 +3599,18 @@ BOOL __stdcall SSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certif
35983599 {
35993600 if(pm0 = AllocateStringM(strlen(Certificate) + 1024))
36003601 {
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))
36033603 {
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);
36083614 }
36093615 FreeDuplicatedString(pm0);
36103616 }
--- a/src/mesg-eng.h
+++ b/src/mesg-eng.h
@@ -324,7 +324,7 @@
324324 #define MSGJPN323 _Tu8("Failed to unload untrustworthy DLLs.", "Failed to unload untrustworthy DLLs.")
325325 #define MSGJPN324 _Tu8("Failed to hook required functions to protect the process.", "Failed to hook required functions to protect the process.")
326326 #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")
328328 #define MSGJPN327 _Tu8("Yes", "Yes")
329329 #define MSGJPN328 _Tu8("No", "No")
330330 #define MSGJPN329 _Tu8("UTF-8 BOM", "UTF-8 BOM")
--- a/src/mesg-jpn.h
+++ b/src/mesg-jpn.h
@@ -324,7 +324,7 @@
324324 #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.")
325325 #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.")
326326 #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")
328328 #define MSGJPN327 _Tu8("はい", "\xE3\x81\xAF\xE3\x81\x84")
329329 #define MSGJPN328 _Tu8("いいえ", "\xE3\x81\x84\xE3\x81\x84\xE3\x81\x88")
330330 #define MSGJPN329 _Tu8("UTF-8 BOM", "UTF-8 BOM")
--- a/src/misc.c
+++ b/src/misc.c
@@ -241,6 +241,11 @@ INT_PTR CALLBACK ExeEscTextDialogProc(HWND hDlg, UINT message, WPARAM wParam, LP
241241 {
242242 switch (message)
243243 {
244+ // 暗号化通信対応
245+ case WM_SHOWWINDOW :
246+ SendDlgItemMessage(hDlg, COMMON_TEXT, EM_SETSEL, 0, 0);
247+ return(TRUE);
248+
244249 case WM_INITDIALOG :
245250 SendDlgItemMessage(hDlg, COMMON_TEXT, WM_SETTEXT, 0, lParam);
246251 return(TRUE);
@@ -2074,3 +2079,42 @@ void DecodeLineFeed(char* Str)
20742079 }
20752080 }
20762081
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+
旧リポジトリブラウザで表示