• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

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

Loweynet


Commit MetaInfo

Revision36d3d8b9ff40fcc9ec7f84bd406d9ccdd0bf3c24 (tree)
Zeit2011-10-16 02:42:25
Autors_kawamoto <s_kawamoto@user...>
Commiters_kawamoto

Log Message

Fix bugs of SSL connection management.

Ä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/main.c
+++ b/main.c
@@ -2837,10 +2837,15 @@ BOOL __stdcall SSLConfirmCallback(BOOL bVerified, LPCSTR Certificate, LPCSTR Com
28372837 char* pm0;
28382838 bResult = FALSE;
28392839 sha_memory((char*)Certificate, (uint32)(strlen(Certificate) * sizeof(char)), (uint32*)&Hash);
2840- for(i = 0; i < MAX_CERT_CACHE_HASH; i++)
2840+ i = 0;
2841+ while(i < MAX_CERT_CACHE_HASH)
28412842 {
28422843 if(memcmp(&CertificateCacheHash[i], &Hash, 20) == 0)
2844+ {
28432845 bResult = TRUE;
2846+ break;
2847+ }
2848+ i++;
28442849 }
28452850 if(!bResult)
28462851 {
--- a/socketwrapper.c
+++ b/socketwrapper.c
@@ -381,13 +381,18 @@ BOOL AttachSSL(SOCKET s, SOCKET parent)
381381 }
382382 EnterCriticalSection(&g_OpenSSLLock);
383383 }
384- if(ConfirmSSLCertificate(*ppSSL))
384+ if(r)
385385 {
386- }
387- else
388- {
389- DetachSSL(s);
390- r = FALSE;
386+ if(ConfirmSSLCertificate(*ppSSL))
387+ {
388+ }
389+ else
390+ {
391+ LeaveCriticalSection(&g_OpenSSLLock);
392+ DetachSSL(s);
393+ r = FALSE;
394+ EnterCriticalSection(&g_OpenSSLLock);
395+ }
391396 }
392397 }
393398 else
@@ -431,7 +436,7 @@ BOOL IsSSLAttached(SOCKET s)
431436 ppSSL = FindSSLPointerFromSocket(s);
432437 LeaveCriticalSection(&g_OpenSSLLock);
433438 if(!ppSSL)
434- return TRUE;
439+ return FALSE;
435440 return TRUE;
436441 }
437442