• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン7980 (tree)
日時2019-08-17 16:18:17
作者yutakapon

ログメッセージ

Windows95サポートのためのパッチを2つ追加した。
不要となったパッチを削除した。
パッチ適用処理全体の見直し。
チケット #36876

変更サマリ

差分

--- branches/openssl_1_1_1_v2/libs/buildopenssl11.bat (revision 7979)
+++ branches/openssl_1_1_1_v2/libs/buildopenssl11.bat (revision 7980)
@@ -18,7 +18,7 @@
1818 perl -e "open(IN,'Configurations/10-main.conf');binmode(STDOUT);while(<IN>){s|/W3|/W1|;s|/WX||;print $_;}close(IN);" > conf.tmp
1919 move conf.tmp Configurations/10-main.conf
2020
21-rem GetModuleHandleExW API依存除去のため
21+rem GetModuleHandleExW API(WindowsXP以降)依存除去のため
2222 perl -e "open(IN,'Configurations/10-main.conf');binmode(STDOUT);while(<IN>){s|(dso_scheme(.+)"win32")|#$1|;print $_;}close(IN);" > conf.tmp
2323 move conf.tmp Configurations/10-main.conf
2424
--- branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW.txt (revision 7979)
+++ branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW.txt (nonexistent)
@@ -1,284 +0,0 @@
1-*** openssl-1.1.1c.org/crypto/rand/rand_win.c 2019-05-28 22:12:20.000000000 +0900
2---- openssl/crypto/rand/rand_win.c 2019-08-03 23:21:53.874985200 +0900
3-***************
4-*** 39,44 ****
5---- 39,80 ----
6- # define INTEL_DEF_PROV L"Intel Hardware Cryptographic Service Provider"
7- # endif
8-
9-+
10-+ #if 0
11-+ typedef struct tagCURSORINFO {
12-+ DWORD cbSize;
13-+ DWORD flags;
14-+ HCURSOR hCursor;
15-+ POINT ptScreenPos;
16-+ } CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
17-+ #endif
18-+
19-+ typedef HWND(WINAPI *GETFOREGROUNDWINDOW) (VOID);
20-+ typedef BOOL(WINAPI *GETCURSORINFO) (PCURSORINFO);
21-+ typedef DWORD(WINAPI *GETQUEUESTATUS) (UINT);
22-+
23-+ typedef HANDLE(WINAPI *CREATETOOLHELP32SNAPSHOT) (DWORD, DWORD);
24-+ typedef BOOL(WINAPI *CLOSETOOLHELP32SNAPSHOT) (HANDLE);
25-+ typedef BOOL(WINAPI *HEAP32FIRST) (LPHEAPENTRY32, DWORD, size_t);
26-+ typedef BOOL(WINAPI *HEAP32NEXT) (LPHEAPENTRY32);
27-+ //typedef BOOL(WINAPI *HEAP32LIST) (HANDLE, LPHEAPLIST32);
28-+ //typedef BOOL(WINAPI *PROCESS32) (HANDLE, LPPROCESSENTRY32);
29-+ //typedef BOOL(WINAPI *THREAD32) (HANDLE, LPTHREADENTRY32);
30-+ //typedef BOOL(WINAPI *MODULE32) (HANDLE, LPMODULEENTRY32);
31-+
32-+ static void add_RAND_buffer(void *srcbuf, int srcnum, void *dstbuf, int *dstoff, int dstmax)
33-+ {
34-+ int off = *dstoff;
35-+
36-+ if (off + srcnum > dstmax)
37-+ return;
38-+
39-+ memcpy((unsigned char*)dstbuf + off , srcbuf, srcnum);
40-+ off += srcnum;
41-+
42-+ *dstoff = off;
43-+ }
44-+
45- size_t rand_pool_acquire_entropy(RAND_POOL *pool)
46- {
47- # ifndef USE_BCRYPTGENRANDOM
48-*************** size_t rand_pool_acquire_entropy(RAND_PO
49-*** 76,81 ****
50---- 112,118 ----
51- if (entropy_available > 0)
52- return entropy_available;
53- # else
54-+ #if 0
55- bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
56- buffer = rand_pool_add_begin(pool, bytes_needed);
57- if (buffer != NULL) {
58-*************** size_t rand_pool_acquire_entropy(RAND_PO
59-*** 114,119 ****
60---- 151,374 ----
61- if (entropy_available > 0)
62- return entropy_available;
63- # endif
64-+ # endif
65-+
66-+ /*
67-+ * for Windows 9x, NT4.0
68-+ */
69-+ bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
70-+ buffer = rand_pool_add_begin(pool, bytes_needed);
71-+ if (buffer != NULL) {
72-+ size_t sum = 0;
73-+ int off = 0;
74-+ DWORD w;
75-+ HMODULE user = NULL;
76-+ HMODULE kernel = LoadLibrary(TEXT("KERNEL32.DLL"));
77-+ MEMORYSTATUS m;
78-+
79-+ user = LoadLibrary(TEXT("USER32.DLL"));
80-+ if (user) {
81-+ GETCURSORINFO cursor;
82-+ GETFOREGROUNDWINDOW win;
83-+ GETQUEUESTATUS queue;
84-+
85-+ win =
86-+ (GETFOREGROUNDWINDOW) GetProcAddress(user,
87-+ "GetForegroundWindow");
88-+ cursor = (GETCURSORINFO) GetProcAddress(user, "GetCursorInfo");
89-+ queue = (GETQUEUESTATUS) GetProcAddress(user, "GetQueueStatus");
90-+
91-+ if (win) {
92-+ /* window handle */
93-+ HWND h = win();
94-+ add_RAND_buffer(&h, sizeof(h), buffer, &off, bytes_needed);
95-+ }
96-+ if (cursor) {
97-+ /*
98-+ * unfortunately, its not safe to call GetCursorInfo() on NT4
99-+ * even though it exists in SP3 (or SP6) and higher.
100-+ */
101-+ //if (check_winnt() && !check_win_minplat(5))
102-+ // cursor = 0;
103-+ }
104-+ if (cursor) {
105-+ /* cursor position */
106-+ /* assume 2 bytes of entropy */
107-+ CURSORINFO ci;
108-+ ci.cbSize = sizeof(CURSORINFO);
109-+ if (cursor(&ci))
110-+ add_RAND_buffer(&ci, ci.cbSize, buffer, &off, bytes_needed);
111-+ }
112-+
113-+ if (queue) {
114-+ /* message queue status */
115-+ /* assume 1 byte of entropy */
116-+ w = queue(QS_ALLEVENTS);
117-+ add_RAND_buffer(&w, sizeof(w), buffer, &off, bytes_needed);
118-+ }
119-+
120-+ FreeLibrary(user);
121-+ }
122-+
123-+ #if 0
124-+ if (kernel) {
125-+ CREATETOOLHELP32SNAPSHOT snap;
126-+ CLOSETOOLHELP32SNAPSHOT close_snap;
127-+ HANDLE handle;
128-+
129-+ HEAP32FIRST heap_first;
130-+ HEAP32NEXT heap_next;
131-+ HEAP32LIST heaplist_first, heaplist_next;
132-+ PROCESS32 process_first, process_next;
133-+ THREAD32 thread_first, thread_next;
134-+ MODULE32 module_first, module_next;
135-+
136-+ HEAPLIST32 hlist;
137-+ HEAPENTRY32 hentry;
138-+ PROCESSENTRY32 p;
139-+ THREADENTRY32 t;
140-+ MODULEENTRY32 m;
141-+ DWORD starttime = 0;
142-+
143-+ snap = (CREATETOOLHELP32SNAPSHOT)
144-+ GetProcAddress(kernel, "CreateToolhelp32Snapshot");
145-+ close_snap = (CLOSETOOLHELP32SNAPSHOT)
146-+ GetProcAddress(kernel, "CloseToolhelp32Snapshot");
147-+ heap_first = (HEAP32FIRST) GetProcAddress(kernel, "Heap32First");
148-+ heap_next = (HEAP32NEXT) GetProcAddress(kernel, "Heap32Next");
149-+ heaplist_first =
150-+ (HEAP32LIST) GetProcAddress(kernel, "Heap32ListFirst");
151-+ heaplist_next =
152-+ (HEAP32LIST) GetProcAddress(kernel, "Heap32ListNext");
153-+ process_first =
154-+ (PROCESS32) GetProcAddress(kernel, "Process32First");
155-+ process_next =
156-+ (PROCESS32) GetProcAddress(kernel, "Process32Next");
157-+ thread_first = (THREAD32) GetProcAddress(kernel, "Thread32First");
158-+ thread_next = (THREAD32) GetProcAddress(kernel, "Thread32Next");
159-+ module_first = (MODULE32) GetProcAddress(kernel, "Module32First");
160-+ module_next = (MODULE32) GetProcAddress(kernel, "Module32Next");
161-+
162-+ if (snap && heap_first && heap_next && heaplist_first &&
163-+ heaplist_next && process_first && process_next &&
164-+ thread_first && thread_next && module_first &&
165-+ module_next && (handle = snap(TH32CS_SNAPALL, 0))
166-+ != INVALID_HANDLE_VALUE) {
167-+ /* heap list and heap walking */
168-+ /*
169-+ * HEAPLIST32 contains 3 fields that will change with each
170-+ * entry. Consider each field a source of 1 byte of entropy.
171-+ * HEAPENTRY32 contains 5 fields that will change with each
172-+ * entry. Consider each field a source of 1 byte of entropy.
173-+ */
174-+ ZeroMemory(&hlist, sizeof(HEAPLIST32));
175-+ hlist.dwSize = sizeof(HEAPLIST32);
176-+ if (good)
177-+ starttime = GetTickCount();
178-+ # ifdef _MSC_VER
179-+ if (heaplist_first(handle, &hlist)) {
180-+ /*
181-+ * following discussion on dev ML, exception on WinCE (or
182-+ * other Win platform) is theoretically of unknown
183-+ * origin; prevent infinite loop here when this
184-+ * theoretical case occurs; otherwise cope with the
185-+ * expected (MSDN documented) exception-throwing
186-+ * behaviour of Heap32Next() on WinCE.
187-+ *
188-+ * based on patch in original message by Tanguy Fautré
189-+ * (2009/03/02) Subject: RAND_poll() and
190-+ * CreateToolhelp32Snapshot() stability
191-+ */
192-+ int ex_cnt_limit = 42;
193-+ do {
194-+ add_RAND_buffer(&hlist, hlist.dwSize, buffer, &off, bytes_needed);
195-+ __try {
196-+ ZeroMemory(&hentry, sizeof(HEAPENTRY32));
197-+ hentry.dwSize = sizeof(HEAPENTRY32);
198-+ if (heap_first(&hentry,
199-+ hlist.th32ProcessID,
200-+ hlist.th32HeapID)) {
201-+ int entrycnt = 80;
202-+ do
203-+ add_RAND_buffer(&hentry, hentry.dwSize, buffer, &off, bytes_needed);
204-+ while (heap_next(&hentry)
205-+ && (!good || NOTTOOLONG(starttime))
206-+ && --entrycnt > 0);
207-+ }
208-+ }
209-+ __except(EXCEPTION_EXECUTE_HANDLER) {
210-+ /*
211-+ * ignore access violations when walking the heap
212-+ * list
213-+ */
214-+ ex_cnt_limit--;
215-+ }
216-+ } while (heaplist_next(handle, &hlist)
217-+ && (!good || NOTTOOLONG(starttime))
218-+ && ex_cnt_limit > 0);
219-+ }
220-+ # endif
221-+
222-+ /* process walking */
223-+ /*
224-+ * PROCESSENTRY32 contains 9 fields that will change with
225-+ * each entry. Consider each field a source of 1 byte of
226-+ * entropy.
227-+ */
228-+ p.dwSize = sizeof(PROCESSENTRY32);
229-+
230-+ if (good)
231-+ starttime = GetTickCount();
232-+ if (process_first(handle, &p))
233-+ do
234-+ add_RAND_buffer(&p, p.dwSize, buffer, &off, bytes_needed);
235-+ while (process_next(handle, &p)
236-+ && (!good || NOTTOOLONG(starttime)));
237-+
238-+ /* thread walking */
239-+ /*
240-+ * THREADENTRY32 contains 6 fields that will change with each
241-+ * entry. Consider each field a source of 1 byte of entropy.
242-+ */
243-+ t.dwSize = sizeof(THREADENTRY32);
244-+ if (good)
245-+ starttime = GetTickCount();
246-+ if (thread_first(handle, &t))
247-+ do
248-+ add_RAND_buffer(&t, t.dwSize, buffer, &off, bytes_needed);
249-+ while (thread_next(handle, &t)
250-+ && (!good || NOTTOOLONG(starttime)));
251-+
252-+ /* module walking */
253-+ /*
254-+ * MODULEENTRY32 contains 9 fields that will change with each
255-+ * entry. Consider each field a source of 1 byte of entropy.
256-+ */
257-+ m.dwSize = sizeof(MODULEENTRY32);
258-+ if (good)
259-+ starttime = GetTickCount();
260-+ if (module_first(handle, &m))
261-+ do
262-+ add_RAND_buffer(&m, m.dwSize, buffer, &off, bytes_needed);
263-+ while (module_next(handle, &m)
264-+ && (!good || NOTTOOLONG(starttime)));
265-+ if (close_snap)
266-+ close_snap(handle);
267-+ else
268-+ CloseHandle(handle);
269-+
270-+ }
271-+
272-+ FreeLibrary(kernel);
273-+ }
274-+ #endif
275-+
276-+ rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed);
277-+ entropy_available = rand_pool_entropy_available(pool);
278-+
279-+ if (entropy_available > 0)
280-+ return entropy_available;
281-+ }
282-
283- return rand_pool_entropy_available(pool);
284- }
--- branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW_win95.txt (nonexistent)
+++ branches/openssl_1_1_1_v2/libs/openssl_patch/CryptAcquireContextW_win95.txt (revision 7980)
@@ -0,0 +1,38 @@
1+*** openssl/crypto/rand/rand_win.c.patched 2019-08-16 23:16:30.259119000 +0900
2+--- openssl/crypto/rand/rand_win.c 2019-08-17 15:08:11.171399500 +0900
3+***************
4+*** 39,44 ****
5+--- 39,71 ----
6+ # define INTEL_DEF_PROV L"Intel Hardware Cryptographic Service Provider"
7+ # endif
8+
9++ #define CryptAcquireContextW myCryptAcquireContextW
10++ typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW)(HCRYPTPROV*, LPCWSTR, LPCWSTR, DWORD, DWORD);
11++ static BOOL myCryptAcquireContextW(
12++ HCRYPTPROV *phProv,
13++ LPCWSTR szContainer,
14++ LPCWSTR szProvider,
15++ DWORD dwProvType,
16++ DWORD dwFlags
17++ )
18++ {
19++ HMODULE mod;
20++ CRYPTACQUIRECONTEXTW func;
21++ BOOL ret;
22++
23++ if ( (mod = GetModuleHandle(TEXT("ADVAPI32.DLL"))) &&
24++ (func = (CRYPTACQUIRECONTEXTW)GetProcAddress(mod, "CryptAcquireContextW"))
25++ ) {
26++
27++ ret = func(phProv, szContainer, szProvider, dwProvType, dwFlags);
28++ return ret;
29++
30++ } else {
31++ return FALSE;
32++
33++ }
34++ }
35++
36+ size_t rand_pool_acquire_entropy(RAND_POOL *pool)
37+ {
38+ # ifndef USE_BCRYPTGENRANDOM
--- branches/openssl_1_1_1_v2/libs/openssl_patch/atomic_api_win95.txt (nonexistent)
+++ branches/openssl_1_1_1_v2/libs/openssl_patch/atomic_api_win95.txt (revision 7980)
@@ -0,0 +1,101 @@
1+*** openssl/crypto/threads_win.c.patched 2019-08-16 23:13:33.040131200 +0900
2+--- openssl/crypto/threads_win.c 2019-08-17 15:04:33.459137000 +0900
3+*************** int myInitializeCriticalSectionAndSpinCo
4+*** 20,52 ****
5+ return 1;
6+ }
7+
8+- #if 0
9+ #define InterlockedCompareExchange(a, b, c) myInterlockedCompareExchange(a, b, c)
10+ LONG myInterlockedCompareExchange(
11+ LPLONG volatile Destination,
12+ LONG Exchange,
13+ LONG Comperand
14+ )
15+ {
16+ LONG ret = *Destination;
17+- OutputDebugPrintf("%s: %x\n", __FUNCTION__, ret);
18+
19+ if (*Destination == Comperand)
20+ ret = InterlockedExchange(Destination, Exchange);
21+ return (ret);
22+ }
23+
24+ #define InterlockedExchangeAdd(a, b) myInterlockedExchangeAdd(a, b)
25+ LONG myInterlockedExchangeAdd(
26+ LONG volatile *Addend,
27+ LONG Value
28+ )
29+ {
30+! OutputDebugPrintf("%s: %x\n", __FUNCTION__, Value);
31+ while (Value-- > 0)
32+ InterlockedIncrement(Addend);
33+ }
34+- #endif
35+
36+ #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && defined(OPENSSL_SYS_WINDOWS)
37+
38+--- 20,82 ----
39+ return 1;
40+ }
41+
42+ #define InterlockedCompareExchange(a, b, c) myInterlockedCompareExchange(a, b, c)
43++ typedef LONG(WINAPI *INTERLOCKEDCOMPAREEXCHANGE)(
44++ LONG volatile *Destination,
45++ LONG ExChange,
46++ LONG Comperand
47++ );
48+ LONG myInterlockedCompareExchange(
49+ LPLONG volatile Destination,
50+ LONG Exchange,
51+ LONG Comperand
52+ )
53+ {
54++ HMODULE mod;
55++ INTERLOCKEDCOMPAREEXCHANGE func;
56++
57++ if ( (mod = GetModuleHandle(TEXT("KERNEL32.DLL"))) &&
58++ (func = (INTERLOCKEDCOMPAREEXCHANGE)GetProcAddress(mod, "InterlockedCompareExchange"))
59++ ) {
60++ return func(Destination, Exchange, Comperand);
61++
62++ } else {
63+ LONG ret = *Destination;
64+
65+ if (*Destination == Comperand)
66+ ret = InterlockedExchange(Destination, Exchange);
67+ return (ret);
68++
69++ }
70+ }
71+
72+ #define InterlockedExchangeAdd(a, b) myInterlockedExchangeAdd(a, b)
73++ typedef LONG(WINAPI *INTERLOCKEDEXCHANGEADD)(
74++ LONG volatile *Addend,
75++ LONG Value
76++ );
77+ LONG myInterlockedExchangeAdd(
78+ LONG volatile *Addend,
79+ LONG Value
80+ )
81+ {
82+! HMODULE mod;
83+! INTERLOCKEDEXCHANGEADD func;
84+!
85+! if ( (mod = GetModuleHandle(TEXT("KERNEL32.DLL"))) &&
86+! (func = (INTERLOCKEDEXCHANGEADD)GetProcAddress(mod, "InterlockedExchangeAdd"))
87+! ) {
88+! return func(Addend, Value);
89+!
90+! } else {
91+! LONG ret = *Addend;
92+!
93+ while (Value-- > 0)
94+ InterlockedIncrement(Addend);
95++
96++ return (ret);
97++ }
98+ }
99+
100+ #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && defined(OPENSSL_SYS_WINDOWS)
101+
--- branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat (revision 7979)
+++ branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat (revision 7980)
@@ -18,11 +18,11 @@
1818
1919 rem パッチの適用有無をチェック
2020
21-rem freeaddrinfo/getnameinfo/getaddrinfo API依存除去のため
2221 :patch1
22+rem freeaddrinfo/getnameinfo/getaddrinfo API(WindowsXP以降)依存除去のため
2323 findstr /c:"# undef AI_PASSIVE" ..\openssl\crypto\bio\bio_lcl.h
2424 if ERRORLEVEL 1 goto fail1
25-goto patch4
25+goto patch2
2626 :fail1
2727 pushd ..
2828 %folder%\patch %cmdopt1% < %folder%\ws2_32_dll_patch.txt
@@ -29,33 +29,28 @@
2929 %folder%\patch %cmdopt2% < %folder%\ws2_32_dll_patch.txt
3030 popd
3131
32-
33-rem CryptAcquireContextW API依存除去のため
32+:patch2
33+:patch3
3434 :patch4
35-rem findstr /c:"add_RAND_buffer" ..\openssl\crypto\rand\rand_win.c
36-rem if ERRORLEVEL 1 goto fail4
37-rem goto patch5
38-rem :fail4
39-rem pushd ..
40-rem %folder%\patch %cmdopt1% < %folder%\CryptAcquireContextW.txt
41-rem %folder%\patch %cmdopt2% < %folder%\CryptAcquireContextW.txt
42-rem popd
4335
4436
37+:patch5
4538 rem WindowsMeでRAND_bytesで落ちる現象回避のため。
46-:patch5
47-findstr /c:"added if meth is NULL pointer" ..\openssl\crypto\rand\rand_lib.c
48-if ERRORLEVEL 1 goto fail5
49-goto patch6
50-:fail5
51-pushd ..
52-%folder%\patch %cmdopt1% < %folder%\RAND_bytes.txt
53-%folder%\patch %cmdopt2% < %folder%\RAND_bytes.txt
54-popd
39+rem OpenSSL 1.0.2ではmethのNULLチェックがあったが、OpenSSL 1.1.1でなくなっている。
40+rem このNULLチェックはなくても問題はなく、本質はInitializeCriticalSectionAndSpinCountにあるため、
41+rem デフォルトでは適用しないものとする。
42+rem findstr /c:"added if meth is NULL pointer" ..\openssl\crypto\rand\rand_lib.c
43+rem if ERRORLEVEL 1 goto fail5
44+rem goto patch6
45+rem :fail5
46+rem pushd ..
47+rem %folder%\patch %cmdopt1% < %folder%\RAND_bytes.txt
48+rem %folder%\patch %cmdopt2% < %folder%\RAND_bytes.txt
49+rem popd
5550
5651
52+:patch6
5753 rem WindowsMeでInitializeCriticalSectionAndSpinCountがエラーとなる現象回避のため。
58-:patch6
5954 findstr /c:"myInitializeCriticalSectionAndSpinCount" ..\openssl\crypto\threads_win.c
6055 if ERRORLEVEL 1 goto fail6
6156 goto patch7
@@ -66,10 +61,10 @@
6661 popd
6762
6863
69-rem WindowsMe/NT4.0ではCryptAcquireContextWによるエントロピー取得が
64+:patch7
65+rem Windows98/Me/NT4.0ではCryptAcquireContextWによるエントロピー取得が
7066 rem できないため、新しく処理を追加する。CryptAcquireContextWの利用は残す。
71-:patch7
72-findstr /c:"void add_RAND_buffer" ..\openssl\crypto\rand\rand_win.c
67+findstr /c:"CryptAcquireContextA" ..\openssl\crypto\rand\rand_win.c
7368 if ERRORLEVEL 1 goto fail7
7469 goto patch8
7570 :fail7
@@ -80,8 +75,39 @@
8075
8176
8277 :patch8
78+rem Windows95では InterlockedCompareExchange と InterlockedCompareExchange が
79+rem 未サポートのため、別の処理で置き換える。
80+rem InitializeCriticalSectionAndSpinCount も未サポートだが、WindowsMe向けの
81+rem 処置に含まれる。
82+findstr /c:"INTERLOCKEDCOMPAREEXCHANGE" ..\openssl\crypto\threads_win.c
83+if ERRORLEVEL 1 goto fail8
84+goto patch9
85+:fail8
86+pushd ..
87+copy /b openssl\crypto\threads_win.c.orig openssl\crypto\threads_win.c.orig2
88+%folder%\patch %cmdopt1% < %folder%\atomic_api_win95.txt
89+%folder%\patch %cmdopt2% < %folder%\atomic_api_win95.txt
90+popd
8391
8492
93+rem Windows95では CryptAcquireContextW が未サポートのため、エラーで返すようにする。
94+rem エラー後は CryptAcquireContextA を使う。
95+:patch9
96+findstr /c:"myCryptAcquireContextW" ..\openssl\crypto\rand\rand_win.c
97+if ERRORLEVEL 1 goto fail9
98+goto patch10
99+:fail9
100+pushd ..
101+copy /b openssl\crypto\rand\rand_win.c.orig openssl\crypto\rand\rand_win.c.orig2
102+%folder%\patch %cmdopt1% < %folder%\CryptAcquireContextW_win95.txt
103+%folder%\patch %cmdopt2% < %folder%\CryptAcquireContextW_win95.txt
104+popd
105+
106+
107+
108+:patch10
109+
110+
85111 :patch_end
86112 echo "パッチは適用されています"
87113 timeout 5
旧リポジトリブラウザで表示