Revision: 7980 https://osdn.net/projects/ttssh2/scm/svn/commits/7980 Author: yutakapon Date: 2019-08-17 16:18:17 +0900 (Sat, 17 Aug 2019) Log Message: ----------- Windows95サポートのためのパッチを2つ追加した。 不要となったパッチを削除した。 パッチ適用処理全体の見直し。 チケット #36876 Ticket Links: ------------ https://osdn.net/projects/ttssh2/tracker/detail/36876 Modified Paths: -------------- branches/openssl_1_1_1_v2/libs/buildopenssl11.bat branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat Added Paths: ----------- branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW_win95.txt branches/openssl_1_1_1_v2/libs/openssl_patch/atomic_api_win95.txt Removed Paths: ------------- branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW.txt -------------- next part -------------- Modified: branches/openssl_1_1_1_v2/libs/buildopenssl11.bat =================================================================== --- branches/openssl_1_1_1_v2/libs/buildopenssl11.bat 2019-08-17 04:58:08 UTC (rev 7979) +++ branches/openssl_1_1_1_v2/libs/buildopenssl11.bat 2019-08-17 07:18:17 UTC (rev 7980) @@ -18,7 +18,7 @@ perl -e "open(IN,'Configurations/10-main.conf');binmode(STDOUT);while(<IN>){s|/W3|/W1|;s|/WX||;print $_;}close(IN);" > conf.tmp move conf.tmp Configurations/10-main.conf -rem GetModuleHandleExW API\x88ˑ\xB6\x8F\x9C\x8B\x8E\x82̂\xBD\x82\xDF +rem GetModuleHandleExW API(WindowsXP\x88ȍ~)\x88ˑ\xB6\x8F\x9C\x8B\x8E\x82̂\xBD\x82\xDF perl -e "open(IN,'Configurations/10-main.conf');binmode(STDOUT);while(<IN>){s|(dso_scheme(.+)"win32")|#$1|;print $_;}close(IN);" > conf.tmp move conf.tmp Configurations/10-main.conf Deleted: branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW.txt =================================================================== --- branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW.txt 2019-08-17 04:58:08 UTC (rev 7979) +++ branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW.txt 2019-08-17 07:18:17 UTC (rev 7980) @@ -1,284 +0,0 @@ -*** openssl-1.1.1c.org/crypto/rand/rand_win.c 2019-05-28 22:12:20.000000000 +0900 ---- openssl/crypto/rand/rand_win.c 2019-08-03 23:21:53.874985200 +0900 -*************** -*** 39,44 **** ---- 39,80 ---- - # define INTEL_DEF_PROV L"Intel Hardware Cryptographic Service Provider" - # endif - -+ -+ #if 0 -+ typedef struct tagCURSORINFO { -+ DWORD cbSize; -+ DWORD flags; -+ HCURSOR hCursor; -+ POINT ptScreenPos; -+ } CURSORINFO, *PCURSORINFO, *LPCURSORINFO; -+ #endif -+ -+ typedef HWND(WINAPI *GETFOREGROUNDWINDOW) (VOID); -+ typedef BOOL(WINAPI *GETCURSORINFO) (PCURSORINFO); -+ typedef DWORD(WINAPI *GETQUEUESTATUS) (UINT); -+ -+ typedef HANDLE(WINAPI *CREATETOOLHELP32SNAPSHOT) (DWORD, DWORD); -+ typedef BOOL(WINAPI *CLOSETOOLHELP32SNAPSHOT) (HANDLE); -+ typedef BOOL(WINAPI *HEAP32FIRST) (LPHEAPENTRY32, DWORD, size_t); -+ typedef BOOL(WINAPI *HEAP32NEXT) (LPHEAPENTRY32); -+ //typedef BOOL(WINAPI *HEAP32LIST) (HANDLE, LPHEAPLIST32); -+ //typedef BOOL(WINAPI *PROCESS32) (HANDLE, LPPROCESSENTRY32); -+ //typedef BOOL(WINAPI *THREAD32) (HANDLE, LPTHREADENTRY32); -+ //typedef BOOL(WINAPI *MODULE32) (HANDLE, LPMODULEENTRY32); -+ -+ static void add_RAND_buffer(void *srcbuf, int srcnum, void *dstbuf, int *dstoff, int dstmax) -+ { -+ int off = *dstoff; -+ -+ if (off + srcnum > dstmax) -+ return; -+ -+ memcpy((unsigned char*)dstbuf + off , srcbuf, srcnum); -+ off += srcnum; -+ -+ *dstoff = off; -+ } -+ - size_t rand_pool_acquire_entropy(RAND_POOL *pool) - { - # ifndef USE_BCRYPTGENRANDOM -*************** size_t rand_pool_acquire_entropy(RAND_PO -*** 76,81 **** ---- 112,118 ---- - if (entropy_available > 0) - return entropy_available; - # else -+ #if 0 - bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); - buffer = rand_pool_add_begin(pool, bytes_needed); - if (buffer != NULL) { -*************** size_t rand_pool_acquire_entropy(RAND_PO -*** 114,119 **** ---- 151,374 ---- - if (entropy_available > 0) - return entropy_available; - # endif -+ # endif -+ -+ /* -+ * for Windows 9x, NT4.0 -+ */ -+ bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); -+ buffer = rand_pool_add_begin(pool, bytes_needed); -+ if (buffer != NULL) { -+ size_t sum = 0; -+ int off = 0; -+ DWORD w; -+ HMODULE user = NULL; -+ HMODULE kernel = LoadLibrary(TEXT("KERNEL32.DLL")); -+ MEMORYSTATUS m; -+ -+ user = LoadLibrary(TEXT("USER32.DLL")); -+ if (user) { -+ GETCURSORINFO cursor; -+ GETFOREGROUNDWINDOW win; -+ GETQUEUESTATUS queue; -+ -+ win = -+ (GETFOREGROUNDWINDOW) GetProcAddress(user, -+ "GetForegroundWindow"); -+ cursor = (GETCURSORINFO) GetProcAddress(user, "GetCursorInfo"); -+ queue = (GETQUEUESTATUS) GetProcAddress(user, "GetQueueStatus"); -+ -+ if (win) { -+ /* window handle */ -+ HWND h = win(); -+ add_RAND_buffer(&h, sizeof(h), buffer, &off, bytes_needed); -+ } -+ if (cursor) { -+ /* -+ * unfortunately, its not safe to call GetCursorInfo() on NT4 -+ * even though it exists in SP3 (or SP6) and higher. -+ */ -+ //if (check_winnt() && !check_win_minplat(5)) -+ // cursor = 0; -+ } -+ if (cursor) { -+ /* cursor position */ -+ /* assume 2 bytes of entropy */ -+ CURSORINFO ci; -+ ci.cbSize = sizeof(CURSORINFO); -+ if (cursor(&ci)) -+ add_RAND_buffer(&ci, ci.cbSize, buffer, &off, bytes_needed); -+ } -+ -+ if (queue) { -+ /* message queue status */ -+ /* assume 1 byte of entropy */ -+ w = queue(QS_ALLEVENTS); -+ add_RAND_buffer(&w, sizeof(w), buffer, &off, bytes_needed); -+ } -+ -+ FreeLibrary(user); -+ } -+ -+ #if 0 -+ if (kernel) { -+ CREATETOOLHELP32SNAPSHOT snap; -+ CLOSETOOLHELP32SNAPSHOT close_snap; -+ HANDLE handle; -+ -+ HEAP32FIRST heap_first; -+ HEAP32NEXT heap_next; -+ HEAP32LIST heaplist_first, heaplist_next; -+ PROCESS32 process_first, process_next; -+ THREAD32 thread_first, thread_next; -+ MODULE32 module_first, module_next; -+ -+ HEAPLIST32 hlist; -+ HEAPENTRY32 hentry; -+ PROCESSENTRY32 p; -+ THREADENTRY32 t; -+ MODULEENTRY32 m; -+ DWORD starttime = 0; -+ -+ snap = (CREATETOOLHELP32SNAPSHOT) -+ GetProcAddress(kernel, "CreateToolhelp32Snapshot"); -+ close_snap = (CLOSETOOLHELP32SNAPSHOT) -+ GetProcAddress(kernel, "CloseToolhelp32Snapshot"); -+ heap_first = (HEAP32FIRST) GetProcAddress(kernel, "Heap32First"); -+ heap_next = (HEAP32NEXT) GetProcAddress(kernel, "Heap32Next"); -+ heaplist_first = -+ (HEAP32LIST) GetProcAddress(kernel, "Heap32ListFirst"); -+ heaplist_next = -+ (HEAP32LIST) GetProcAddress(kernel, "Heap32ListNext"); -+ process_first = -+ (PROCESS32) GetProcAddress(kernel, "Process32First"); -+ process_next = -+ (PROCESS32) GetProcAddress(kernel, "Process32Next"); -+ thread_first = (THREAD32) GetProcAddress(kernel, "Thread32First"); -+ thread_next = (THREAD32) GetProcAddress(kernel, "Thread32Next"); -+ module_first = (MODULE32) GetProcAddress(kernel, "Module32First"); -+ module_next = (MODULE32) GetProcAddress(kernel, "Module32Next"); -+ -+ if (snap && heap_first && heap_next && heaplist_first && -+ heaplist_next && process_first && process_next && -+ thread_first && thread_next && module_first && -+ module_next && (handle = snap(TH32CS_SNAPALL, 0)) -+ != INVALID_HANDLE_VALUE) { -+ /* heap list and heap walking */ -+ /* -+ * HEAPLIST32 contains 3 fields that will change with each -+ * entry. Consider each field a source of 1 byte of entropy. -+ * HEAPENTRY32 contains 5 fields that will change with each -+ * entry. Consider each field a source of 1 byte of entropy. -+ */ -+ ZeroMemory(&hlist, sizeof(HEAPLIST32)); -+ hlist.dwSize = sizeof(HEAPLIST32); -+ if (good) -+ starttime = GetTickCount(); -+ # ifdef _MSC_VER -+ if (heaplist_first(handle, &hlist)) { -+ /* -+ * following discussion on dev ML, exception on WinCE (or -+ * other Win platform) is theoretically of unknown -+ * origin; prevent infinite loop here when this -+ * theoretical case occurs; otherwise cope with the -+ * expected (MSDN documented) exception-throwing -+ * behaviour of Heap32Next() on WinCE. -+ * -+ * based on patch in original message by Tanguy Fautré -+ * (2009/03/02) Subject: RAND_poll() and -+ * CreateToolhelp32Snapshot() stability -+ */ -+ int ex_cnt_limit = 42; -+ do { -+ add_RAND_buffer(&hlist, hlist.dwSize, buffer, &off, bytes_needed); -+ __try { -+ ZeroMemory(&hentry, sizeof(HEAPENTRY32)); -+ hentry.dwSize = sizeof(HEAPENTRY32); -+ if (heap_first(&hentry, -+ hlist.th32ProcessID, -+ hlist.th32HeapID)) { -+ int entrycnt = 80; -+ do -+ add_RAND_buffer(&hentry, hentry.dwSize, buffer, &off, bytes_needed); -+ while (heap_next(&hentry) -+ && (!good || NOTTOOLONG(starttime)) -+ && --entrycnt > 0); -+ } -+ } -+ __except(EXCEPTION_EXECUTE_HANDLER) { -+ /* -+ * ignore access violations when walking the heap -+ * list -+ */ -+ ex_cnt_limit--; -+ } -+ } while (heaplist_next(handle, &hlist) -+ && (!good || NOTTOOLONG(starttime)) -+ && ex_cnt_limit > 0); -+ } -+ # endif -+ -+ /* process walking */ -+ /* -+ * PROCESSENTRY32 contains 9 fields that will change with -+ * each entry. Consider each field a source of 1 byte of -+ * entropy. -+ */ -+ p.dwSize = sizeof(PROCESSENTRY32); -+ -+ if (good) -+ starttime = GetTickCount(); -+ if (process_first(handle, &p)) -+ do -+ add_RAND_buffer(&p, p.dwSize, buffer, &off, bytes_needed); -+ while (process_next(handle, &p) -+ && (!good || NOTTOOLONG(starttime))); -+ -+ /* thread walking */ -+ /* -+ * THREADENTRY32 contains 6 fields that will change with each -+ * entry. Consider each field a source of 1 byte of entropy. -+ */ -+ t.dwSize = sizeof(THREADENTRY32); -+ if (good) -+ starttime = GetTickCount(); -+ if (thread_first(handle, &t)) -+ do -+ add_RAND_buffer(&t, t.dwSize, buffer, &off, bytes_needed); -+ while (thread_next(handle, &t) -+ && (!good || NOTTOOLONG(starttime))); -+ -+ /* module walking */ -+ /* -+ * MODULEENTRY32 contains 9 fields that will change with each -+ * entry. Consider each field a source of 1 byte of entropy. -+ */ -+ m.dwSize = sizeof(MODULEENTRY32); -+ if (good) -+ starttime = GetTickCount(); -+ if (module_first(handle, &m)) -+ do -+ add_RAND_buffer(&m, m.dwSize, buffer, &off, bytes_needed); -+ while (module_next(handle, &m) -+ && (!good || NOTTOOLONG(starttime))); -+ if (close_snap) -+ close_snap(handle); -+ else -+ CloseHandle(handle); -+ -+ } -+ -+ FreeLibrary(kernel); -+ } -+ #endif -+ -+ rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed); -+ entropy_available = rand_pool_entropy_available(pool); -+ -+ if (entropy_available > 0) -+ return entropy_available; -+ } - - return rand_pool_entropy_available(pool); - } Added: branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW_win95.txt =================================================================== --- branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW_win95.txt (rev 0) +++ branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW_win95.txt 2019-08-17 07:18:17 UTC (rev 7980) @@ -0,0 +1,38 @@ +*** openssl/crypto/rand/rand_win.c.patched 2019-08-16 23:16:30.259119000 +0900 +--- openssl/crypto/rand/rand_win.c 2019-08-17 15:08:11.171399500 +0900 +*************** +*** 39,44 **** +--- 39,71 ---- + # define INTEL_DEF_PROV L"Intel Hardware Cryptographic Service Provider" + # endif + ++ #define CryptAcquireContextW myCryptAcquireContextW ++ typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW)(HCRYPTPROV*, LPCWSTR, LPCWSTR, DWORD, DWORD); ++ static BOOL myCryptAcquireContextW( ++ HCRYPTPROV *phProv, ++ LPCWSTR szContainer, ++ LPCWSTR szProvider, ++ DWORD dwProvType, ++ DWORD dwFlags ++ ) ++ { ++ HMODULE mod; ++ CRYPTACQUIRECONTEXTW func; ++ BOOL ret; ++ ++ if ( (mod = GetModuleHandle(TEXT("ADVAPI32.DLL"))) && ++ (func = (CRYPTACQUIRECONTEXTW)GetProcAddress(mod, "CryptAcquireContextW")) ++ ) { ++ ++ ret = func(phProv, szContainer, szProvider, dwProvType, dwFlags); ++ return ret; ++ ++ } else { ++ return FALSE; ++ ++ } ++ } ++ + size_t rand_pool_acquire_entropy(RAND_POOL *pool) + { + # ifndef USE_BCRYPTGENRANDOM Added: branches/openssl_1_1_1_v2/libs/openssl_patch/atomic_api_win95.txt =================================================================== --- branches/openssl_1_1_1_v2/libs/openssl_patch/atomic_api_win95.txt (rev 0) +++ branches/openssl_1_1_1_v2/libs/openssl_patch/atomic_api_win95.txt 2019-08-17 07:18:17 UTC (rev 7980) @@ -0,0 +1,101 @@ +*** openssl/crypto/threads_win.c.patched 2019-08-16 23:13:33.040131200 +0900 +--- openssl/crypto/threads_win.c 2019-08-17 15:04:33.459137000 +0900 +*************** int myInitializeCriticalSectionAndSpinCo +*** 20,52 **** + return 1; + } + +- #if 0 + #define InterlockedCompareExchange(a, b, c) myInterlockedCompareExchange(a, b, c) + LONG myInterlockedCompareExchange( + LPLONG volatile Destination, + LONG Exchange, + LONG Comperand + ) + { + LONG ret = *Destination; +- OutputDebugPrintf("%s: %x\n", __FUNCTION__, ret); + + if (*Destination == Comperand) + ret = InterlockedExchange(Destination, Exchange); + return (ret); + } + + #define InterlockedExchangeAdd(a, b) myInterlockedExchangeAdd(a, b) + LONG myInterlockedExchangeAdd( + LONG volatile *Addend, + LONG Value + ) + { +! OutputDebugPrintf("%s: %x\n", __FUNCTION__, Value); + while (Value-- > 0) + InterlockedIncrement(Addend); + } +- #endif + + #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && defined(OPENSSL_SYS_WINDOWS) + +--- 20,82 ---- + return 1; + } + + #define InterlockedCompareExchange(a, b, c) myInterlockedCompareExchange(a, b, c) ++ typedef LONG(WINAPI *INTERLOCKEDCOMPAREEXCHANGE)( ++ LONG volatile *Destination, ++ LONG ExChange, ++ LONG Comperand ++ ); + LONG myInterlockedCompareExchange( + LPLONG volatile Destination, + LONG Exchange, + LONG Comperand + ) + { ++ HMODULE mod; ++ INTERLOCKEDCOMPAREEXCHANGE func; ++ ++ if ( (mod = GetModuleHandle(TEXT("KERNEL32.DLL"))) && ++ (func = (INTERLOCKEDCOMPAREEXCHANGE)GetProcAddress(mod, "InterlockedCompareExchange")) ++ ) { ++ return func(Destination, Exchange, Comperand); ++ ++ } else { + LONG ret = *Destination; + + if (*Destination == Comperand) + ret = InterlockedExchange(Destination, Exchange); + return (ret); ++ ++ } + } + + #define InterlockedExchangeAdd(a, b) myInterlockedExchangeAdd(a, b) ++ typedef LONG(WINAPI *INTERLOCKEDEXCHANGEADD)( ++ LONG volatile *Addend, ++ LONG Value ++ ); + LONG myInterlockedExchangeAdd( + LONG volatile *Addend, + LONG Value + ) + { +! HMODULE mod; +! INTERLOCKEDEXCHANGEADD func; +! +! if ( (mod = GetModuleHandle(TEXT("KERNEL32.DLL"))) && +! (func = (INTERLOCKEDEXCHANGEADD)GetProcAddress(mod, "InterlockedExchangeAdd")) +! ) { +! return func(Addend, Value); +! +! } else { +! LONG ret = *Addend; +! + while (Value-- > 0) + InterlockedIncrement(Addend); ++ ++ return (ret); ++ } + } + + #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && defined(OPENSSL_SYS_WINDOWS) + Modified: branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat =================================================================== --- branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat 2019-08-17 04:58:08 UTC (rev 7979) +++ branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat 2019-08-17 07:18:17 UTC (rev 7980) @@ -18,11 +18,11 @@ rem \x83p\x83b\x83`\x82̓K\x97p\x97L\x96\xB3\x82\xF0\x83`\x83F\x83b\x83N -rem freeaddrinfo/getnameinfo/getaddrinfo API\x88ˑ\xB6\x8F\x9C\x8B\x8E\x82̂\xBD\x82\xDF :patch1 +rem freeaddrinfo/getnameinfo/getaddrinfo API(WindowsXP\x88ȍ~)\x88ˑ\xB6\x8F\x9C\x8B\x8E\x82̂\xBD\x82\xDF findstr /c:"# undef AI_PASSIVE" ..\openssl\crypto\bio\bio_lcl.h if ERRORLEVEL 1 goto fail1 -goto patch4 +goto patch2 :fail1 pushd .. %folder%\patch %cmdopt1% < %folder%\ws2_32_dll_patch.txt @@ -29,33 +29,28 @@ %folder%\patch %cmdopt2% < %folder%\ws2_32_dll_patch.txt popd - -rem CryptAcquireContextW API\x88ˑ\xB6\x8F\x9C\x8B\x8E\x82̂\xBD\x82\xDF +:patch2 +:patch3 :patch4 -rem findstr /c:"add_RAND_buffer" ..\openssl\crypto\rand\rand_win.c -rem if ERRORLEVEL 1 goto fail4 -rem goto patch5 -rem :fail4 -rem pushd .. -rem %folder%\patch %cmdopt1% < %folder%\CryptAcquireContextW.txt -rem %folder%\patch %cmdopt2% < %folder%\CryptAcquireContextW.txt -rem popd +:patch5 rem WindowsMe\x82\xC5RAND_bytes\x82ŗ\x8E\x82\xBF\x82錻\x8Fۉ\xF1\x94\xF0\x82̂\xBD\x82߁B -:patch5 -findstr /c:"added if meth is NULL pointer" ..\openssl\crypto\rand\rand_lib.c -if ERRORLEVEL 1 goto fail5 -goto patch6 -:fail5 -pushd .. -%folder%\patch %cmdopt1% < %folder%\RAND_bytes.txt -%folder%\patch %cmdopt2% < %folder%\RAND_bytes.txt -popd +rem OpenSSL 1.0.2\x82ł\xCDmeth\x82\xCCNULL\x83`\x83F\x83b\x83N\x82\xAA\x82\xA0\x82\xC1\x82\xBD\x82\xAA\x81AOpenSSL 1.1.1\x82łȂ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xE9\x81B +rem \x82\xB1\x82\xCCNULL\x83`\x83F\x83b\x83N\x82͂Ȃ\xAD\x82Ă\xE0\x96\xE2\x91\xE8\x82͂Ȃ\xAD\x81A\x96{\x8E\xBF\x82\xCDInitializeCriticalSectionAndSpinCount\x82ɂ\xA0\x82邽\x82߁A +rem \x83f\x83t\x83H\x83\x8B\x83g\x82ł͓K\x97p\x82\xB5\x82Ȃ\xA2\x82\xE0\x82̂Ƃ\xB7\x82\xE9\x81B +rem findstr /c:"added if meth is NULL pointer" ..\openssl\crypto\rand\rand_lib.c +rem if ERRORLEVEL 1 goto fail5 +rem goto patch6 +rem :fail5 +rem pushd .. +rem %folder%\patch %cmdopt1% < %folder%\RAND_bytes.txt +rem %folder%\patch %cmdopt2% < %folder%\RAND_bytes.txt +rem popd +:patch6 rem WindowsMe\x82\xC5InitializeCriticalSectionAndSpinCount\x82\xAA\x83G\x83\x89\x81[\x82ƂȂ錻\x8Fۉ\xF1\x94\xF0\x82̂\xBD\x82߁B -:patch6 findstr /c:"myInitializeCriticalSectionAndSpinCount" ..\openssl\crypto\threads_win.c if ERRORLEVEL 1 goto fail6 goto patch7 @@ -66,10 +61,10 @@ popd -rem WindowsMe/NT4.0\x82ł\xCDCryptAcquireContextW\x82ɂ\xE6\x82\xE9\x83G\x83\x93\x83g\x83\x8D\x83s\x81[\x8E擾\x82\xAA +:patch7 +rem Windows98/Me/NT4.0\x82ł\xCDCryptAcquireContextW\x82ɂ\xE6\x82\xE9\x83G\x83\x93\x83g\x83\x8D\x83s\x81[\x8E擾\x82\xAA rem \x82ł\xAB\x82Ȃ\xA2\x82\xBD\x82߁A\x90V\x82\xB5\x82\xAD\x8F\x88\x97\x9D\x82\xF0\x92lj\xC1\x82\xB7\x82\xE9\x81BCryptAcquireContextW\x82̗\x98\x97p\x82͎c\x82\xB7\x81B -:patch7 -findstr /c:"void add_RAND_buffer" ..\openssl\crypto\rand\rand_win.c +findstr /c:"CryptAcquireContextA" ..\openssl\crypto\rand\rand_win.c if ERRORLEVEL 1 goto fail7 goto patch8 :fail7 @@ -80,8 +75,39 @@ :patch8 +rem Windows95\x82ł\xCD InterlockedCompareExchange \x82\xC6 InterlockedCompareExchange \x82\xAA +rem \x96\xA2\x83T\x83|\x81[\x83g\x82̂\xBD\x82߁A\x95ʂ̏\x88\x97\x9D\x82Œu\x82\xAB\x8A\xB7\x82\xA6\x82\xE9\x81B +rem InitializeCriticalSectionAndSpinCount \x82\xE0\x96\xA2\x83T\x83|\x81[\x83g\x82\xBE\x82\xAA\x81AWindowsMe\x8C\xFC\x82\xAF\x82\xCC +rem \x8F\x88\x92u\x82Ɋ܂܂\xEA\x82\xE9\x81B +findstr /c:"INTERLOCKEDCOMPAREEXCHANGE" ..\openssl\crypto\threads_win.c +if ERRORLEVEL 1 goto fail8 +goto patch9 +:fail8 +pushd .. +copy /b openssl\crypto\threads_win.c.orig openssl\crypto\threads_win.c.orig2 +%folder%\patch %cmdopt1% < %folder%\atomic_api_win95.txt +%folder%\patch %cmdopt2% < %folder%\atomic_api_win95.txt +popd +rem Windows95\x82ł\xCD CryptAcquireContextW \x82\xAA\x96\xA2\x83T\x83|\x81[\x83g\x82̂\xBD\x82߁A\x83G\x83\x89\x81[\x82ŕԂ\xB7\x82悤\x82ɂ\xB7\x82\xE9\x81B +rem \x83G\x83\x89\x81[\x8C\xE3\x82\xCD CryptAcquireContextA \x82\xF0\x8Eg\x82\xA4\x81B +:patch9 +findstr /c:"myCryptAcquireContextW" ..\openssl\crypto\rand\rand_win.c +if ERRORLEVEL 1 goto fail9 +goto patch10 +:fail9 +pushd .. +copy /b openssl\crypto\rand\rand_win.c.orig openssl\crypto\rand\rand_win.c.orig2 +%folder%\patch %cmdopt1% < %folder%\CryptAcquireContextW_win95.txt +%folder%\patch %cmdopt2% < %folder%\CryptAcquireContextW_win95.txt +popd + + + +:patch10 + + :patch_end echo "\x83p\x83b\x83`\x82͓K\x97p\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB7" timeout 5