Loweynet
Révision | 5befc7d950367d9e43888d1e7003cfa49da7b90b (tree) |
---|---|
l'heure | 2014-06-29 17:04:21 |
Auteur | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Enhance all settings encryption.
Fix spelling mistakes.
Modify documents.
Fix bugs that some settings are not loaded correctly.
@@ -2,7 +2,7 @@ | ||
2 | 2 | [Software Name] FFFTP Ver.1.99 (FTP Client software) |
3 | 3 | [Copyright] Copyright(C) 1997-2010 Sota & cooperators |
4 | 4 | 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 | |
6 | 6 | ============================================================ |
7 | 7 | |
8 | 8 | About INI File |
@@ -31,10 +31,17 @@ File -> | ||
31 | 31 | Changes in Ver.1.99 |
32 | 32 | -------------------- |
33 | 33 | |
34 | +-- Tested on Windows 8.1 (32bit/64bit). | |
35 | + | |
34 | 36 | -- Added the feature of automatic software update. |
35 | 37 | It will connect to the dedicated server to check whether there are updates |
36 | 38 | every 7 days by default, and then confirm whether to apply them. |
37 | 39 | |
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 | + | |
38 | 45 | -- Fixed bugs that the apprication did not start when the INI file was modified |
39 | 46 | and BOM was inserted in it. |
40 | 47 |
@@ -68,6 +75,13 @@ Changes in Ver.1.99 | ||
68 | 75 | -- Supported high DPI displays. |
69 | 76 | The interface such as the menu will look smooth on high DPI displays. |
70 | 77 | |
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 | + | |
71 | 85 | |
72 | 86 | Outline |
73 | 87 | ------- |
@@ -3,10 +3,17 @@ FFFTP version history. | ||
3 | 3 | Changes in Ver.1.99 |
4 | 4 | -------------------- |
5 | 5 | |
6 | +-- Tested on Windows 8.1 (32bit/64bit). | |
7 | + | |
6 | 8 | -- Added the feature of automatic software update. |
7 | 9 | It will connect to the dedicated server to check whether there are updates |
8 | 10 | every 7 days by default, and then confirm whether to apply them. |
9 | 11 | |
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 | + | |
10 | 17 | -- Fixed bugs that the apprication did not start when the INI file was modified |
11 | 18 | and BOM was inserted in it. |
12 | 19 |
@@ -40,6 +47,29 @@ Changes in Ver.1.99 | ||
40 | 47 | -- Supported high DPI displays. |
41 | 48 | The interface such as the menu will look smooth on high DPI displays. |
42 | 49 | |
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 | + | |
43 | 73 | Changes in Ver.1.98g |
44 | 74 | -------------------- |
45 | 75 |
@@ -1,6 +1,6 @@ | ||
1 | 1 | ============================================================ |
2 | 2 | y\tg¼z@FTPNCAg FFFTPisf.jpÅj Ver 1.99 |
3 | -y®ìmF«z@Windows 8A7AVistaAXPA2000 | |
3 | +y®ìmF«z@Windows 8.1A8A7AVistaAXPA2000 | |
4 | 4 | yT|[gz@http://sourceforge.jp/projects/ffftp/ |
5 | 5 | ============================================================ |
6 | 6 |
@@ -30,10 +30,17 @@ FFFTP Ver.1.96d+009 | ||
30 | 30 | Ver 1.99ÅÌÏX_ |
31 | 31 | ------------------- |
32 | 32 | |
33 | +EWindows 8.1 (32bit/64bit)Å®ìðmFµÜµ½B | |
34 | + | |
33 | 35 | E\tgEFAÌ©®XV@\ðÇÁµÜµ½B |
34 | 36 | @ùèÅÍ7ú²ÆÉêpÌT[o[ÉÚ±µÄXVª é©Ç¤©mFµA |
35 | 37 | @XVª êÎXVðKp·é©Ç¤©[U[ÉmFµÜ·B |
36 | 38 | |
39 | +E}X^[pX[hðp¢ÄSÄÌÝèðû·é@\ðÇÁµÜµ½B | |
40 | +@}EFAâæOÒÉæèÝè©çÂlîñðÇÝæçêÈÈèÜ·ªA | |
41 | +@1.98gÈOÅÍÝèðÇÝßÈèÜ·ÌÅӵľ³¢B | |
42 | +@±Ì@\ÍùèÅͳøÉÈÁĢܷB | |
43 | + | |
37 | 44 | EINIt@CªüϳêBOMªtÁ³êÄ¢éêÉNbV ·éoOð |
38 | 45 | @C³µÜµ½B |
39 | 46 |
@@ -73,6 +80,12 @@ Ver 1.99 | ||
73 | 80 | EDPIfBXvCÉεܵ½B |
74 | 81 | @DPIfBXvCÉ\¦·éÛÉj [ÈÇÌ\¦ªç©ÉÈèÜ·B |
75 | 82 | |
83 | +EÝèðFileZilla XML`®ÉGNX|[g·é@\ðÇÁµÜµ½B | |
84 | + | |
85 | +EzXgÌÝèÉã¢Ã»û®ðgpµÈ¢ÝèðÇÁµÜµ½B | |
86 | +@SSL 2.0â®Ìxª128rbg¢ÌÃðÛ·éæ¤ÉÈèÜ·B | |
87 | +@±Ì@\ÍùèÅÍLøÉÈèÜ·B | |
88 | + | |
76 | 89 | |
77 | 90 | Ver 1.96dÈOÖß·ê |
78 | 91 | ----------------------- |
@@ -2,10 +2,17 @@ FFFTP | ||
2 | 2 | |
3 | 3 | ¡Ver 1.99 |
4 | 4 | |
5 | +EWindows 8.1 (32bit/64bit)Å®ìðmFµÜµ½B | |
6 | + | |
5 | 7 | E\tgEFAÌ©®XV@\ðÇÁµÜµ½B |
6 | 8 | @ùèÅÍ7ú²ÆÉêpÌT[o[ÉÚ±µÄXVª é©Ç¤©mFµA |
7 | 9 | @XVª êÎXVðKp·é©Ç¤©[U[ÉmFµÜ·B |
8 | 10 | |
11 | +E}X^[pX[hðp¢ÄSÄÌÝèðû·é@\ðÇÁµÜµ½B | |
12 | +@}EFAâæOÒÉæèÝè©çÂlîñðÇÝæçêÈÈèÜ·ªA | |
13 | +@1.98gÈOÅÍÝèðÇÝßÈèÜ·ÌÅӵľ³¢B | |
14 | +@±Ì@\ÍùèÅͳøÉÈÁĢܷB | |
15 | + | |
9 | 16 | EINIt@CªüϳêBOMªtÁ³êÄ¢éêÉNbV ·éoOð |
10 | 17 | @C³µÜµ½B |
11 | 18 |
@@ -45,6 +52,25 @@ FFFTP | ||
45 | 52 | EDPIfBXvCÉεܵ½B |
46 | 53 | @DPIfBXvCÉ\¦·éÛÉj [ÈÇÌ\¦ªç©ÉÈèÜ·B |
47 | 54 | |
55 | +EÝèðFileZilla XML`®ÉGNX|[g·é@\ðÇÁµÜµ½B | |
56 | + | |
57 | +EzXgÌÝèÉã¢Ã»û®ðgpµÈ¢ÝèðÇÁµÜµ½B | |
58 | +@SSL 2.0â®Ìxª128rbg¢ÌÃðÛ·éæ¤ÉÈèÜ·B | |
59 | +@±Ì@\ÍùèÅÍLøÉÈèÜ·B | |
60 | + | |
61 | +¡Ver 1.98g2 | |
62 | + | |
63 | +ECXg[ÅÉZIPÅÌt@Cª¬üµÄ¢½âèðC³µÜµ½B | |
64 | + | |
65 | +E[gؾÌÏXªo³ê½|ÌbZ[Wª\¦³êéoOðC³ | |
66 | +@µÜµ½B | |
67 | + | |
68 | +¡Ver 1.98g1 | |
69 | + | |
70 | +EOpenSSLðXVµÜµ½B | |
71 | + | |
72 | +ESSL/TLSÌ[gؾðXVµÜµ½B | |
73 | + | |
48 | 74 | ¡Ver 1.98g |
49 | 75 | |
50 | 76 | EWindows 8 (32bit/64bit)Å®ìðmFµÜµ½B |
@@ -1051,6 +1051,8 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set) | ||
1051 | 1051 | Set->UseFTPES = Pos->Set.UseFTPES; |
1052 | 1052 | Set->UseFTPIS = Pos->Set.UseFTPIS; |
1053 | 1053 | Set->UseSFTP = Pos->Set.UseSFTP; |
1054 | + strcpy(Set->PrivateKey, Pos->Set.PrivateKey); | |
1055 | + Set->NoWeakEncryption = Pos->Set.NoWeakEncryption; | |
1054 | 1056 | // 同時接続対応 |
1055 | 1057 | Set->MaxThreadCount = Pos->Set.MaxThreadCount; |
1056 | 1058 | Set->ReuseCmdSkt = Pos->Set.ReuseCmdSkt; |
@@ -1347,7 +1349,7 @@ void CopyDefaultHost(HOSTDATA *Set) | ||
1347 | 1349 | Set->UseFTPIS = YES; |
1348 | 1350 | Set->UseSFTP = YES; |
1349 | 1351 | strcpy(Set->PrivateKey, ""); |
1350 | - Set->NoWeakEncryption = NO; | |
1352 | + Set->NoWeakEncryption = YES; | |
1351 | 1353 | // 同時接続対応 |
1352 | 1354 | Set->MaxThreadCount = 1; |
1353 | 1355 | Set->ReuseCmdSkt = YES; |
@@ -99,8 +99,10 @@ static int StrReadIn(char *Src, int Max, char *Dst); | ||
99 | 99 | int CheckPasswordValidity( char* Password, int length, const char* HashStr, int StretchCount ); |
100 | 100 | void CreatePasswordHash( char* Password, int length, char* HashStr, int StretchCount ); |
101 | 101 | void SetHashSalt( DWORD salt ); |
102 | +// 全設定暗号化対応 | |
103 | +void SetHashSalt1(void* Salt, int Length); | |
102 | 104 | |
103 | -DWORD GetRandamDWRODValue(void); | |
105 | +DWORD GetRandamDWORDValue(void); | |
104 | 106 | |
105 | 107 | // 全設定暗号化対応 |
106 | 108 | void GetMaskWithHMACSHA1(DWORD IV, const char* Salt, int SaltLength, void* pHash); |
@@ -308,22 +310,60 @@ int ValidateMasterPassword(void) | ||
308 | 310 | int salt = 0; |
309 | 311 | // 全設定暗号化対応 |
310 | 312 | int stretch = 0; |
313 | + unsigned char salt1[16]; | |
311 | 314 | |
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 ){ | |
317 | 320 | // 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); | |
318 | 339 | 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: | |
321 | 343 | IsMasterPasswordError = PASSWORD_UNMATCH; |
322 | 344 | 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: | |
324 | 365 | IsMasterPasswordError = PASSWORD_OK; |
325 | 366 | break; |
326 | - case 2: /* invalid hash */ | |
327 | 367 | default: |
328 | 368 | IsMasterPasswordError = BAD_PASSWORD_HASH; |
329 | 369 | break; |
@@ -378,25 +418,38 @@ void SaveRegistry(void) | ||
378 | 418 | { |
379 | 419 | char buf[48]; |
380 | 420 | int salt = GetTickCount(); |
421 | + // 全設定暗号化対応 | |
422 | + unsigned char salt1[16]; | |
423 | + FILETIME ft[4]; | |
381 | 424 | |
382 | 425 | WriteIntValueToReg(hKey3, "Version", VER_NUM); |
383 | - WriteIntValueToReg(hKey3, "CredentialSalt", salt); | |
384 | - | |
385 | - SetHashSalt( salt ); | |
386 | - /* save password hash */ | |
387 | 426 | // 全設定暗号化対応 |
427 | +// WriteIntValueToReg(hKey3, "CredentialSalt", salt); | |
428 | +// | |
429 | +// SetHashSalt( salt ); | |
430 | +// /* save password hash */ | |
388 | 431 | // CreatePasswordHash( SecretKey, SecretKeyLength, buf ); |
432 | +// WriteStringToReg(hKey3, "CredentialCheck", buf); | |
389 | 433 | if(EncryptAllSettings == YES) |
390 | 434 | { |
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)); | |
391 | 442 | WriteIntValueToReg(hKey3, "CredentialStretch", 65535); |
392 | - CreatePasswordHash( SecretKey, SecretKeyLength, buf, 65535 ); | |
443 | + CreatePasswordHash(SecretKey, SecretKeyLength, buf, 65535); | |
444 | + WriteStringToReg(hKey3, "CredentialCheck1", buf); | |
393 | 445 | } |
394 | 446 | else |
395 | 447 | { |
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); | |
398 | 452 | } |
399 | - WriteStringToReg(hKey3, "CredentialCheck", buf); | |
400 | 453 | |
401 | 454 | // 全設定暗号化対応 |
402 | 455 | WriteIntValueToReg(hKey3, "EncryptAll", EncryptAllSettings); |
@@ -573,6 +626,7 @@ void SaveRegistry(void) | ||
573 | 626 | SaveIntNum(hKey5, "SFTP", Hist.UseSFTP, DefaultHist.UseSFTP); |
574 | 627 | EncodePassword(Hist.PrivateKey, Str); |
575 | 628 | SaveStr(hKey5, "PKey", Str, DefaultHist.PrivateKey); |
629 | + SaveIntNum(hKey5, "NoWeak", Hist.NoWeakEncryption, DefaultHist.NoWeakEncryption); | |
576 | 630 | // 同時接続対応 |
577 | 631 | SaveIntNum(hKey5, "ThreadCount", Hist.MaxThreadCount, DefaultHist.MaxThreadCount); |
578 | 632 | SaveIntNum(hKey5, "ReuseCmdSkt", Hist.ReuseCmdSkt, DefaultHist.ReuseCmdSkt); |
@@ -748,6 +802,31 @@ void SaveRegistry(void) | ||
748 | 802 | CloseSubKey(hKey4); |
749 | 803 | } |
750 | 804 | 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"); | |
751 | 830 | } |
752 | 831 | CloseReg(hKey3); |
753 | 832 | } |
@@ -812,36 +891,33 @@ int LoadRegistry(void) | ||
812 | 891 | IniKanjiCode = KANJI_SJIS; |
813 | 892 | |
814 | 893 | // 全設定暗号化対応 |
815 | - if(Version >= 1990) | |
894 | + if(GetMasterPasswordStatus() == PASSWORD_OK) | |
816 | 895 | { |
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) | |
818 | 903 | { |
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)) | |
826 | 905 | { |
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; | |
845 | 921 | } |
846 | 922 | } |
847 | 923 | } |
@@ -1062,6 +1138,7 @@ int LoadRegistry(void) | ||
1062 | 1138 | strcpy(Str, ""); |
1063 | 1139 | ReadStringFromReg(hKey5, "PKey", Str, PRIVATE_KEY_LEN*4+1); |
1064 | 1140 | DecodePassword(Str, Hist.PrivateKey); |
1141 | + ReadIntValueFromReg(hKey5, "NoWeak", &Hist.NoWeakEncryption); | |
1065 | 1142 | // 同時接続対応 |
1066 | 1143 | ReadIntValueFromReg(hKey5, "ThreadCount", &Hist.MaxThreadCount); |
1067 | 1144 | ReadIntValueFromReg(hKey5, "ReuseCmdSkt", &Hist.ReuseCmdSkt); |
@@ -1074,6 +1151,8 @@ int LoadRegistry(void) | ||
1074 | 1151 | // 再転送対応 |
1075 | 1152 | ReadIntValueFromReg(hKey5, "ErrMode", &Hist.TransferErrorMode); |
1076 | 1153 | ReadIntValueFromReg(hKey5, "ErrNotify", &Hist.TransferErrorNotify); |
1154 | + // セッションあたりの転送量制限対策 | |
1155 | + ReadIntValueFromReg(hKey5, "ErrReconnect", &Hist.TransferErrorReconnect); | |
1077 | 1156 | |
1078 | 1157 | CloseSubKey(hKey5); |
1079 | 1158 | AddHistoryToHistory(&Hist); |
@@ -1832,7 +1911,7 @@ static void EncodePassword3(char *Str, char *Buf, const char *Key) | ||
1832 | 1911 | /* PAD部分を乱数で埋める StrPad[StrLen](が有効な場合) は NUL */ |
1833 | 1912 | for(StrPadIndex = StrLen + 1; StrPadIndex < StrPadLen;) |
1834 | 1913 | { |
1835 | - RandValue = GetRandamDWRODValue(); | |
1914 | + RandValue = GetRandamDWORDValue(); | |
1836 | 1915 | for(RandByteCount = 0; RandByteCount < 4; RandByteCount++) |
1837 | 1916 | { |
1838 | 1917 | if(StrPadIndex < StrPadLen) |
@@ -1846,7 +1925,7 @@ static void EncodePassword3(char *Str, char *Buf, const char *Key) | ||
1846 | 1925 | // IVの初期化 |
1847 | 1926 | for(IvIndex = 0; IvIndex < AES_BLOCK_SIZE;) |
1848 | 1927 | { |
1849 | - RandValue = GetRandamDWRODValue(); | |
1928 | + RandValue = GetRandamDWORDValue(); | |
1850 | 1929 | for(RandByteCount = 0; RandByteCount < 4; RandByteCount++) |
1851 | 1930 | { |
1852 | 1931 | if(IvIndex < AES_BLOCK_SIZE) |
@@ -3392,15 +3471,34 @@ void CreatePasswordHash( char* Password, int length, char* HashStr, int StretchC | ||
3392 | 3471 | |
3393 | 3472 | void SetHashSalt( DWORD salt ) |
3394 | 3473 | { |
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]; | |
3396 | 3478 | *pos++ = ( salt >> 24 ) & 0xff; |
3397 | 3479 | *pos++ = ( salt >> 16 ) & 0xff; |
3398 | 3480 | *pos++ = ( salt >> 8 ) & 0xff; |
3399 | 3481 | *pos++ = ( salt ) & 0xff; |
3400 | 3482 | |
3401 | - SecretKeyLength = strlen( SecretKey ) + 5; | |
3483 | +// SecretKeyLength = strlen( SecretKey ) + 5; | |
3484 | + SetHashSalt1(&c, 4); | |
3402 | 3485 | } |
3403 | 3486 | |
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 | + | |
3404 | 3502 | /*----------- 乱数生成をする ------------------------------------------------- |
3405 | 3503 | * |
3406 | 3504 | * Parameter |
@@ -3408,7 +3506,7 @@ void SetHashSalt( DWORD salt ) | ||
3408 | 3506 | * Return Value |
3409 | 3507 | * ランダムな値:コンパイラVS2005/動作環境WinXP以上では rand_s から取得する |
3410 | 3508 | *----------------------------------------------------------------------------*/ |
3411 | -DWORD GetRandamDWRODValue(void) | |
3509 | +DWORD GetRandamDWORDValue(void) | |
3412 | 3510 | { |
3413 | 3511 | DWORD rndValue; |
3414 | 3512 | int errorCode; |