• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

FFFTPのソースコードです。


Commit MetaInfo

Revision5befc7d950367d9e43888d1e7003cfa49da7b90b (tree)
Zeit2014-06-29 17:04:21
Autors_kawamoto <s_kawamoto@user...>
Commiters_kawamoto

Log Message

Enhance all settings encryption.
Fix spelling mistakes.
Modify documents.
Fix bugs that some settings are not loaded correctly.

Ändern Zusammenfassung

Diff

Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
--- a/doc/eng/FFFTP.txt
+++ b/doc/eng/FFFTP.txt
@@ -2,7 +2,7 @@
22 [Software Name] FFFTP Ver.1.99 (FTP Client software)
33 [Copyright] Copyright(C) 1997-2010 Sota & cooperators
44 Copyright (C) 2011-2014 FFFTP Project (Hiromichi Matsushima, Suguru Kawamoto, IWAMOTO Kouichi, vitamin0x, unarist, Asami, fortran90, tomo1192, Yuji Tanaka, Moriguchi Hirokazu, Fu-sen).
5-[Environment] Windows 8, 7, Vista, XP, 2000
5+[Environment] Windows 8.1, 8, 7, Vista, XP, 2000
66 ============================================================
77
88 About INI File
@@ -31,10 +31,17 @@ File ->
3131 Changes in Ver.1.99
3232 --------------------
3333
34+-- Tested on Windows 8.1 (32bit/64bit).
35+
3436 -- Added the feature of automatic software update.
3537 It will connect to the dedicated server to check whether there are updates
3638 every 7 days by default, and then confirm whether to apply them.
3739
40+-- Added a feature to encrypt the all settings with the master password.
41+ This prevents malwares and third parties from skimming personal information.
42+ Please note that 1.98g or former versions cannot read encrypted settings.
43+ This feature is disabled by default.
44+
3845 -- Fixed bugs that the apprication did not start when the INI file was modified
3946 and BOM was inserted in it.
4047
@@ -68,6 +75,13 @@ Changes in Ver.1.99
6875 -- Supported high DPI displays.
6976 The interface such as the menu will look smooth on high DPI displays.
7077
78+-- Added a feature to export settings as FileZilla XML format.
79+
80+-- Added an option not to use weak encryption methods for each host.
81+ This refuses SSL 2.0 and encryption algorithms whose keys are shorter than
82+ 128 bits.
83+ This feature is enabled by default.
84+
7185
7286 Outline
7387 -------
--- a/doc/eng/history.txt
+++ b/doc/eng/history.txt
@@ -3,10 +3,17 @@ FFFTP version history.
33 Changes in Ver.1.99
44 --------------------
55
6+-- Tested on Windows 8.1 (32bit/64bit).
7+
68 -- Added the feature of automatic software update.
79 It will connect to the dedicated server to check whether there are updates
810 every 7 days by default, and then confirm whether to apply them.
911
12+-- Added a feature to encrypt the all settings with the master password.
13+ This prevents malwares and third parties from skimming personal information.
14+ Please note that 1.98g or former versions cannot read encrypted settings.
15+ This feature is disabled by default.
16+
1017 -- Fixed bugs that the apprication did not start when the INI file was modified
1118 and BOM was inserted in it.
1219
@@ -40,6 +47,29 @@ Changes in Ver.1.99
4047 -- Supported high DPI displays.
4148 The interface such as the menu will look smooth on high DPI displays.
4249
50+-- Added a feature to export settings as FileZilla XML format.
51+
52+-- Added an option not to use weak encryption methods for each host.
53+ This refuses SSL 2.0 and encryption algorithms whose keys are shorter than
54+ 128 bits.
55+ This feature is enabled by default.
56+
57+Changes in Ver.1.98g2
58+--------------------
59+
60+-- Fixed the issue that the installer was contaminated by a file for the ZIP
61+ version.
62+
63+-- Fixed bugs that the message indicating that SSL/TLS root CAs had been
64+ modified was displayed.
65+
66+Changes in Ver.1.98g1
67+--------------------
68+
69+-- Updated OpenSSL.
70+
71+-- Updated SSL/TLS root CAs.
72+
4373 Changes in Ver.1.98g
4474 --------------------
4575
--- a/doc/jpn/FFFTP.txt
+++ b/doc/jpn/FFFTP.txt
@@ -1,6 +1,6 @@
11 ============================================================
22 yƒ\ƒtƒg–¼z@FTPƒNƒ‰ƒCƒAƒ“ƒg FFFTPisf.jp”Łj Ver 1.99
3-y“®ìŠm”FŠÂ‹«z@Windows 8A7AVistaAXPA2000
3+y“®ìŠm”FŠÂ‹«z@Windows 8.1A8A7AVistaAXPA2000
44 yƒTƒ|[ƒgz@http://sourceforge.jp/projects/ffftp/
55 ============================================================
66
@@ -30,10 +30,17 @@ FFFTP Ver.1.96d+009
3030 Ver 1.99‚ł̕ύX“_
3131 -------------------
3232
33+EWindows 8.1 (32bit/64bit)‚Å“®ì‚ðŠm”F‚µ‚Ü‚µ‚½B
34+
3335 Eƒ\ƒtƒgƒEƒFƒA‚ÌŽ©“®XV‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B
3436 @Šù’è‚Å‚Í7“ú‚²‚Ƃɐê—p‚̃T[ƒo[‚ɐڑ±‚µ‚čXV‚ª‚ ‚é‚©‚Ç‚¤‚©Šm”F‚µA
3537 @XV‚ª‚ ‚ê‚΍XV‚ð“K—p‚·‚é‚©‚Ç‚¤‚©ƒ†[ƒU[‚ÉŠm”F‚µ‚Ü‚·B
3638
39+Eƒ}ƒXƒ^[ƒpƒXƒ[ƒh‚ð—p‚¢‚Ä‘S‚Ă̐ݒè‚ðˆÃ†‰»‚·‚é‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B
40+@ƒ}ƒ‹ƒEƒFƒA‚â‘æŽOŽÒ‚É‚æ‚èÝ’è‚©‚çŒÂlî•ñ‚ð“Ç‚ÝŽæ‚ç‚ê‚È‚­‚È‚è‚Ü‚·‚ªA
41+@1.98gˆÈ‘O‚ł͐ݒè‚ð“ǂݍž‚ß‚È‚è‚Ü‚·‚Ì‚Å’ˆÓ‚µ‚Ä‚­‚¾‚³‚¢B
42+@‚±‚Ì‹@”\‚ÍŠù’è‚Å‚Í–³Œø‚É‚È‚Á‚Ä‚¢‚Ü‚·B
43+
3744 EINIƒtƒ@ƒCƒ‹‚ª‰ü•Ï‚³‚êBOM‚ª•t‰Á‚³‚ê‚Ä‚¢‚éê‡‚ɃNƒ‰ƒbƒVƒ…‚·‚éƒoƒO‚ð
3845 @C³‚µ‚Ü‚µ‚½B
3946
@@ -73,6 +80,12 @@ Ver 1.99
7380 E‚DPIƒfƒBƒXƒvƒŒƒC‚ɑΉž‚µ‚Ü‚µ‚½B
7481 @‚DPIƒfƒBƒXƒvƒŒƒC‚É•\Ž¦‚·‚éÛ‚Ƀƒjƒ…[‚È‚Ç‚Ì•\Ž¦‚ªŠŠ‚ç‚©‚É‚È‚è‚Ü‚·B
7582
83+EÝ’è‚ðFileZilla XMLŒ`Ž®‚ɃGƒNƒXƒ|[ƒg‚·‚é‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B
84+
85+EƒzƒXƒg‚̐ݒè‚ÉŽã‚¢ˆÃ†‰»•ûŽ®‚ðŽg—p‚µ‚È‚¢Ý’è‚ð’ljÁ‚µ‚Ü‚µ‚½B
86+@SSL 2.0‚⌮‚Ì‹­“x‚ª128ƒrƒbƒg–¢–ž‚̈͆‚ð‹‘”Û‚·‚é‚悤‚É‚È‚è‚Ü‚·B
87+@‚±‚Ì‹@”\‚ÍŠù’è‚Å‚Í—LŒø‚É‚È‚è‚Ü‚·B
88+
7689
7790 Ver 1.96dˆÈ‘O‚Ö–ß‚·ê‡
7891 -----------------------
--- a/doc/jpn/history.txt
+++ b/doc/jpn/history.txt
@@ -2,10 +2,17 @@ FFFTP
22
33 ¡Ver 1.99
44
5+EWindows 8.1 (32bit/64bit)‚Å“®ì‚ðŠm”F‚µ‚Ü‚µ‚½B
6+
57 Eƒ\ƒtƒgƒEƒFƒA‚ÌŽ©“®XV‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B
68 @Šù’è‚Å‚Í7“ú‚²‚Ƃɐê—p‚̃T[ƒo[‚ɐڑ±‚µ‚čXV‚ª‚ ‚é‚©‚Ç‚¤‚©Šm”F‚µA
79 @XV‚ª‚ ‚ê‚΍XV‚ð“K—p‚·‚é‚©‚Ç‚¤‚©ƒ†[ƒU[‚ÉŠm”F‚µ‚Ü‚·B
810
11+Eƒ}ƒXƒ^[ƒpƒXƒ[ƒh‚ð—p‚¢‚Ä‘S‚Ă̐ݒè‚ðˆÃ†‰»‚·‚é‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B
12+@ƒ}ƒ‹ƒEƒFƒA‚â‘æŽOŽÒ‚É‚æ‚èÝ’è‚©‚çŒÂlî•ñ‚ð“Ç‚ÝŽæ‚ç‚ê‚È‚­‚È‚è‚Ü‚·‚ªA
13+@1.98gˆÈ‘O‚ł͐ݒè‚ð“ǂݍž‚ß‚È‚è‚Ü‚·‚Ì‚Å’ˆÓ‚µ‚Ä‚­‚¾‚³‚¢B
14+@‚±‚Ì‹@”\‚ÍŠù’è‚Å‚Í–³Œø‚É‚È‚Á‚Ä‚¢‚Ü‚·B
15+
916 EINIƒtƒ@ƒCƒ‹‚ª‰ü•Ï‚³‚êBOM‚ª•t‰Á‚³‚ê‚Ä‚¢‚éê‡‚ɃNƒ‰ƒbƒVƒ…‚·‚éƒoƒO‚ð
1017 @C³‚µ‚Ü‚µ‚½B
1118
@@ -45,6 +52,25 @@ FFFTP
4552 E‚DPIƒfƒBƒXƒvƒŒƒC‚ɑΉž‚µ‚Ü‚µ‚½B
4653 @‚DPIƒfƒBƒXƒvƒŒƒC‚É•\Ž¦‚·‚éÛ‚Ƀƒjƒ…[‚È‚Ç‚Ì•\Ž¦‚ªŠŠ‚ç‚©‚É‚È‚è‚Ü‚·B
4754
55+EÝ’è‚ðFileZilla XMLŒ`Ž®‚ɃGƒNƒXƒ|[ƒg‚·‚é‹@”\‚ð’ljÁ‚µ‚Ü‚µ‚½B
56+
57+EƒzƒXƒg‚̐ݒè‚ÉŽã‚¢ˆÃ†‰»•ûŽ®‚ðŽg—p‚µ‚È‚¢Ý’è‚ð’ljÁ‚µ‚Ü‚µ‚½B
58+@SSL 2.0‚⌮‚Ì‹­“x‚ª128ƒrƒbƒg–¢–ž‚̈͆‚ð‹‘”Û‚·‚é‚悤‚É‚È‚è‚Ü‚·B
59+@‚±‚Ì‹@”\‚ÍŠù’è‚Å‚Í—LŒø‚É‚È‚è‚Ü‚·B
60+
61+¡Ver 1.98g2
62+
63+EƒCƒ“ƒXƒg[ƒ‰”Å‚ÉZIP”ł̃tƒ@ƒCƒ‹‚ª¬“ü‚µ‚Ä‚¢‚½–â‘è‚ðC³‚µ‚Ü‚µ‚½B
64+
65+Eƒ‹[ƒgØ–¾‘‚̕ύX‚ªŒŸo‚³‚ꂽŽ|‚̃ƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚éƒoƒO‚ðC³
66+@‚µ‚Ü‚µ‚½B
67+
68+¡Ver 1.98g1
69+
70+EOpenSSL‚ðXV‚µ‚Ü‚µ‚½B
71+
72+ESSL/TLS‚̃‹[ƒgØ–¾‘‚ðXV‚µ‚Ü‚µ‚½B
73+
4874 ¡Ver 1.98g
4975
5076 EWindows 8 (32bit/64bit)‚Å“®ì‚ðŠm”F‚µ‚Ü‚µ‚½B
--- a/hostman.c
+++ b/hostman.c
@@ -1051,6 +1051,8 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set)
10511051 Set->UseFTPES = Pos->Set.UseFTPES;
10521052 Set->UseFTPIS = Pos->Set.UseFTPIS;
10531053 Set->UseSFTP = Pos->Set.UseSFTP;
1054+ strcpy(Set->PrivateKey, Pos->Set.PrivateKey);
1055+ Set->NoWeakEncryption = Pos->Set.NoWeakEncryption;
10541056 // 同時接続対応
10551057 Set->MaxThreadCount = Pos->Set.MaxThreadCount;
10561058 Set->ReuseCmdSkt = Pos->Set.ReuseCmdSkt;
@@ -1347,7 +1349,7 @@ void CopyDefaultHost(HOSTDATA *Set)
13471349 Set->UseFTPIS = YES;
13481350 Set->UseSFTP = YES;
13491351 strcpy(Set->PrivateKey, "");
1350- Set->NoWeakEncryption = NO;
1352+ Set->NoWeakEncryption = YES;
13511353 // 同時接続対応
13521354 Set->MaxThreadCount = 1;
13531355 Set->ReuseCmdSkt = YES;
--- a/registry.c
+++ b/registry.c
@@ -99,8 +99,10 @@ static int StrReadIn(char *Src, int Max, char *Dst);
9999 int CheckPasswordValidity( char* Password, int length, const char* HashStr, int StretchCount );
100100 void CreatePasswordHash( char* Password, int length, char* HashStr, int StretchCount );
101101 void SetHashSalt( DWORD salt );
102+// 全設定暗号化対応
103+void SetHashSalt1(void* Salt, int Length);
102104
103-DWORD GetRandamDWRODValue(void);
105+DWORD GetRandamDWORDValue(void);
104106
105107 // 全設定暗号化対応
106108 void GetMaskWithHMACSHA1(DWORD IV, const char* Salt, int SaltLength, void* pHash);
@@ -308,22 +310,60 @@ int ValidateMasterPassword(void)
308310 int salt = 0;
309311 // 全設定暗号化対応
310312 int stretch = 0;
313+ unsigned char salt1[16];
311314
312- if( ReadIntValueFromReg(hKey3, "CredentialSalt", &salt)){
313- SetHashSalt( salt );
314- }
315- if( ReadStringFromReg(hKey3, "CredentialCheck", checkbuf, sizeof( checkbuf )) == FFFTP_SUCCESS ){
316- // 全設定暗号化対応
315+ // 全設定暗号化対応
316+// if( ReadIntValueFromReg(hKey3, "CredentialSalt", &salt)){
317+// SetHashSalt( salt );
318+// }
319+// if( ReadStringFromReg(hKey3, "CredentialCheck", checkbuf, sizeof( checkbuf )) == FFFTP_SUCCESS ){
317320 // switch( CheckPasswordValidity( SecretKey, SecretKeyLength, checkbuf ) ){
321+// case 0: /* not match */
322+// IsMasterPasswordError = PASSWORD_UNMATCH;
323+// break;
324+// case 1: /* match */
325+// IsMasterPasswordError = PASSWORD_OK;
326+// break;
327+// case 2: /* invalid hash */
328+// default:
329+// IsMasterPasswordError = BAD_PASSWORD_HASH;
330+// break;
331+// }
332+// }
333+ if(ReadStringFromReg(hKey3, "CredentialCheck1", checkbuf, sizeof(checkbuf)) == FFFTP_SUCCESS)
334+ {
335+ if(ReadBinaryFromReg(hKey3, "CredentialSalt1", &salt1, sizeof(salt1)) == FFFTP_SUCCESS)
336+ SetHashSalt1(&salt1, 16);
337+ else
338+ SetHashSalt1(NULL, 0);
318339 ReadIntValueFromReg(hKey3, "CredentialStretch", &stretch);
319- switch( CheckPasswordValidity( SecretKey, SecretKeyLength, checkbuf, stretch ) ){
320- case 0: /* not match */
340+ switch(CheckPasswordValidity(SecretKey, SecretKeyLength, checkbuf, stretch))
341+ {
342+ case 0:
321343 IsMasterPasswordError = PASSWORD_UNMATCH;
322344 break;
323- case 1: /* match */
345+ case 1:
346+ IsMasterPasswordError = PASSWORD_OK;
347+ break;
348+ default:
349+ IsMasterPasswordError = BAD_PASSWORD_HASH;
350+ break;
351+ }
352+ }
353+ else if(ReadStringFromReg(hKey3, "CredentialCheck", checkbuf, sizeof(checkbuf)) == FFFTP_SUCCESS)
354+ {
355+ if(ReadIntValueFromReg(hKey3, "CredentialSalt", &salt) == FFFTP_SUCCESS)
356+ SetHashSalt(salt);
357+ else
358+ SetHashSalt1(NULL, 0);
359+ switch(CheckPasswordValidity(SecretKey, SecretKeyLength, checkbuf, 0))
360+ {
361+ case 0:
362+ IsMasterPasswordError = PASSWORD_UNMATCH;
363+ break;
364+ case 1:
324365 IsMasterPasswordError = PASSWORD_OK;
325366 break;
326- case 2: /* invalid hash */
327367 default:
328368 IsMasterPasswordError = BAD_PASSWORD_HASH;
329369 break;
@@ -378,25 +418,38 @@ void SaveRegistry(void)
378418 {
379419 char buf[48];
380420 int salt = GetTickCount();
421+ // 全設定暗号化対応
422+ unsigned char salt1[16];
423+ FILETIME ft[4];
381424
382425 WriteIntValueToReg(hKey3, "Version", VER_NUM);
383- WriteIntValueToReg(hKey3, "CredentialSalt", salt);
384-
385- SetHashSalt( salt );
386- /* save password hash */
387426 // 全設定暗号化対応
427+// WriteIntValueToReg(hKey3, "CredentialSalt", salt);
428+//
429+// SetHashSalt( salt );
430+// /* save password hash */
388431 // CreatePasswordHash( SecretKey, SecretKeyLength, buf );
432+// WriteStringToReg(hKey3, "CredentialCheck", buf);
389433 if(EncryptAllSettings == YES)
390434 {
435+ GetProcessTimes(GetCurrentProcess(), &ft[0], &ft[1], &ft[2], &ft[3]);
436+ memcpy(&salt1[0], &salt, 4);
437+ memcpy(&salt1[4], &ft[0].dwLowDateTime, 4);
438+ memcpy(&salt1[8], &ft[2].dwLowDateTime, 4);
439+ memcpy(&salt1[12], &ft[3].dwLowDateTime, 4);
440+ SetHashSalt1(&salt1, 16);
441+ WriteBinaryToReg(hKey3, "CredentialSalt1", &salt1, sizeof(salt1));
391442 WriteIntValueToReg(hKey3, "CredentialStretch", 65535);
392- CreatePasswordHash( SecretKey, SecretKeyLength, buf, 65535 );
443+ CreatePasswordHash(SecretKey, SecretKeyLength, buf, 65535);
444+ WriteStringToReg(hKey3, "CredentialCheck1", buf);
393445 }
394446 else
395447 {
396- WriteIntValueToReg(hKey3, "CredentialStretch", 0);
397- CreatePasswordHash( SecretKey, SecretKeyLength, buf, 0 );
448+ SetHashSalt( salt );
449+ WriteIntValueToReg(hKey3, "CredentialSalt", salt);
450+ CreatePasswordHash(SecretKey, SecretKeyLength, buf, 0);
451+ WriteStringToReg(hKey3, "CredentialCheck", buf);
398452 }
399- WriteStringToReg(hKey3, "CredentialCheck", buf);
400453
401454 // 全設定暗号化対応
402455 WriteIntValueToReg(hKey3, "EncryptAll", EncryptAllSettings);
@@ -573,6 +626,7 @@ void SaveRegistry(void)
573626 SaveIntNum(hKey5, "SFTP", Hist.UseSFTP, DefaultHist.UseSFTP);
574627 EncodePassword(Hist.PrivateKey, Str);
575628 SaveStr(hKey5, "PKey", Str, DefaultHist.PrivateKey);
629+ SaveIntNum(hKey5, "NoWeak", Hist.NoWeakEncryption, DefaultHist.NoWeakEncryption);
576630 // 同時接続対応
577631 SaveIntNum(hKey5, "ThreadCount", Hist.MaxThreadCount, DefaultHist.MaxThreadCount);
578632 SaveIntNum(hKey5, "ReuseCmdSkt", Hist.ReuseCmdSkt, DefaultHist.ReuseCmdSkt);
@@ -748,6 +802,31 @@ void SaveRegistry(void)
748802 CloseSubKey(hKey4);
749803 }
750804 DeleteSubKey(hKey3, "Options");
805+ DeleteValue(hKey3, "CredentialSalt");
806+ DeleteValue(hKey3, "CredentialCheck");
807+ }
808+ else
809+ {
810+ if(OpenSubKey(hKey3, "EncryptedOptions", &hKey4) == FFFTP_SUCCESS)
811+ {
812+ for(i = 0; ; i++)
813+ {
814+ sprintf(Str, "Host%d", i);
815+ if(DeleteSubKey(hKey4, Str) != FFFTP_SUCCESS)
816+ break;
817+ }
818+ for(i = 0; ; i++)
819+ {
820+ sprintf(Str, "History%d", i);
821+ if(DeleteSubKey(hKey4, Str) != FFFTP_SUCCESS)
822+ break;
823+ }
824+ CloseSubKey(hKey4);
825+ }
826+ DeleteSubKey(hKey3, "EncryptedOptions");
827+ DeleteValue(hKey3, "CredentialSalt1");
828+ DeleteValue(hKey3, "CredentialStretch");
829+ DeleteValue(hKey3, "CredentialCheck1");
751830 }
752831 CloseReg(hKey3);
753832 }
@@ -812,36 +891,33 @@ int LoadRegistry(void)
812891 IniKanjiCode = KANJI_SJIS;
813892
814893 // 全設定暗号化対応
815- if(Version >= 1990)
894+ if(GetMasterPasswordStatus() == PASSWORD_OK)
816895 {
817- if(GetMasterPasswordStatus() == PASSWORD_OK)
896+ ReadIntValueFromReg(hKey3, "EncryptAll", &EncryptAllSettings);
897+ sprintf(Buf, "%d", EncryptAllSettings);
898+ ReadStringFromReg(hKey3, "EncryptAllDetector", Str, 255);
899+ DecodePassword(Str, Buf2);
900+ EncryptSettings = EncryptAllSettings;
901+ memset(&EncryptSettingsChecksum, 0, 20);
902+ if(strcmp(Buf, Buf2) != 0)
818903 {
819- ReadIntValueFromReg(hKey3, "EncryptAll", &EncryptAllSettings);
820- sprintf(Buf, "%d", EncryptAllSettings);
821- ReadStringFromReg(hKey3, "EncryptAllDetector", Str, 255);
822- DecodePassword(Str, Buf2);
823- EncryptSettings = EncryptAllSettings;
824- memset(&EncryptSettingsChecksum, 0, 20);
825- if(strcmp(Buf, Buf2) != 0)
904+ switch(DialogBox(GetFtpInst(), MAKEINTRESOURCE(corruptsettings_dlg), GetMainHwnd(), AnyButtonDialogProc))
826905 {
827- switch(DialogBox(GetFtpInst(), MAKEINTRESOURCE(corruptsettings_dlg), GetMainHwnd(), AnyButtonDialogProc))
828- {
829- case IDCANCEL:
830- Terminate();
831- break;
832- case IDABORT:
833- CloseReg(hKey3);
834- ClearRegistry();
835- ClearIni();
836- Restart();
837- Terminate();
838- break;
839- case IDRETRY:
840- EncryptSettingsError = YES;
841- break;
842- case IDIGNORE:
843- break;
844- }
906+ case IDCANCEL:
907+ Terminate();
908+ break;
909+ case IDABORT:
910+ CloseReg(hKey3);
911+ ClearRegistry();
912+ ClearIni();
913+ Restart();
914+ Terminate();
915+ break;
916+ case IDRETRY:
917+ EncryptSettingsError = YES;
918+ break;
919+ case IDIGNORE:
920+ break;
845921 }
846922 }
847923 }
@@ -1062,6 +1138,7 @@ int LoadRegistry(void)
10621138 strcpy(Str, "");
10631139 ReadStringFromReg(hKey5, "PKey", Str, PRIVATE_KEY_LEN*4+1);
10641140 DecodePassword(Str, Hist.PrivateKey);
1141+ ReadIntValueFromReg(hKey5, "NoWeak", &Hist.NoWeakEncryption);
10651142 // 同時接続対応
10661143 ReadIntValueFromReg(hKey5, "ThreadCount", &Hist.MaxThreadCount);
10671144 ReadIntValueFromReg(hKey5, "ReuseCmdSkt", &Hist.ReuseCmdSkt);
@@ -1074,6 +1151,8 @@ int LoadRegistry(void)
10741151 // 再転送対応
10751152 ReadIntValueFromReg(hKey5, "ErrMode", &Hist.TransferErrorMode);
10761153 ReadIntValueFromReg(hKey5, "ErrNotify", &Hist.TransferErrorNotify);
1154+ // セッションあたりの転送量制限対策
1155+ ReadIntValueFromReg(hKey5, "ErrReconnect", &Hist.TransferErrorReconnect);
10771156
10781157 CloseSubKey(hKey5);
10791158 AddHistoryToHistory(&Hist);
@@ -1832,7 +1911,7 @@ static void EncodePassword3(char *Str, char *Buf, const char *Key)
18321911 /* PAD部分を乱数で埋める StrPad[StrLen](が有効な場合) は NUL */
18331912 for(StrPadIndex = StrLen + 1; StrPadIndex < StrPadLen;)
18341913 {
1835- RandValue = GetRandamDWRODValue();
1914+ RandValue = GetRandamDWORDValue();
18361915 for(RandByteCount = 0; RandByteCount < 4; RandByteCount++)
18371916 {
18381917 if(StrPadIndex < StrPadLen)
@@ -1846,7 +1925,7 @@ static void EncodePassword3(char *Str, char *Buf, const char *Key)
18461925 // IVの初期化
18471926 for(IvIndex = 0; IvIndex < AES_BLOCK_SIZE;)
18481927 {
1849- RandValue = GetRandamDWRODValue();
1928+ RandValue = GetRandamDWORDValue();
18501929 for(RandByteCount = 0; RandByteCount < 4; RandByteCount++)
18511930 {
18521931 if(IvIndex < AES_BLOCK_SIZE)
@@ -3392,15 +3471,34 @@ void CreatePasswordHash( char* Password, int length, char* HashStr, int StretchC
33923471
33933472 void SetHashSalt( DWORD salt )
33943473 {
3395- unsigned char* pos = &SecretKey[strlen(SecretKey) + 1];
3474+ // 全設定暗号化対応
3475+// unsigned char* pos = &SecretKey[strlen(SecretKey) + 1];
3476+ unsigned char c[4];
3477+ unsigned char* pos = &c[0];
33963478 *pos++ = ( salt >> 24 ) & 0xff;
33973479 *pos++ = ( salt >> 16 ) & 0xff;
33983480 *pos++ = ( salt >> 8 ) & 0xff;
33993481 *pos++ = ( salt ) & 0xff;
34003482
3401- SecretKeyLength = strlen( SecretKey ) + 5;
3483+// SecretKeyLength = strlen( SecretKey ) + 5;
3484+ SetHashSalt1(&c, 4);
34023485 }
34033486
3487+// 全設定暗号化対応
3488+void SetHashSalt1(void* Salt, int Length)
3489+{
3490+ void* p;
3491+ if(Salt != NULL)
3492+ {
3493+ p = &SecretKey[strlen(SecretKey) + 1];
3494+ memcpy(p, Salt, Length);
3495+ SecretKeyLength = (int)strlen(SecretKey) + 1 + Length;
3496+ }
3497+ else
3498+ SecretKeyLength = (int)strlen(SecretKey) + 1;
3499+}
3500+
3501+
34043502 /*----------- 乱数生成をする -------------------------------------------------
34053503 *
34063504 * Parameter
@@ -3408,7 +3506,7 @@ void SetHashSalt( DWORD salt )
34083506 * Return Value
34093507 * ランダムな値:コンパイラVS2005/動作環境WinXP以上では rand_s から取得する
34103508 *----------------------------------------------------------------------------*/
3411-DWORD GetRandamDWRODValue(void)
3509+DWORD GetRandamDWORDValue(void)
34123510 {
34133511 DWORD rndValue;
34143512 int errorCode;