[Ttssh2-commit] [7833] OpenSSLへのパッチ適用を自動化した。

scmno****@osdn***** scmno****@osdn*****
2019年 7月 8日 (月) 10:56:44 JST


Revision: 7833
          https://osdn.net/projects/ttssh2/scm/svn/commits/7833
Author:   yutakapon
Date:     2019-07-08 10:56:43 +0900 (Mon, 08 Jul 2019)
Log Message:
-----------
OpenSSLへのパッチ適用を自動化した。
チケット #36876 

Ticket Links:
------------
    https://osdn.net/projects/ttssh2/tracker/detail/36876

Modified Paths:
--------------
    branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat
    branches/openssl_1_1_1_v2/libs/openssl_patch/ws2_32_dll_patch.txt

-------------- next part --------------
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-07-07 14:13:50 UTC (rev 7832)
+++ branches/openssl_1_1_1_v2/libs/openssl_patch/check_patch.bat	2019-07-08 01:56:43 UTC (rev 7833)
@@ -1,20 +1,50 @@
 @echo off
 
+set folder=openssl_patch
+set cmdopt2=--binary --backup -p0
+set cmdopt1=--dry-run %cmdopt2%
+
 rem
-rem OpenSSL 1.1.1\x82Ƀp\x83b\x83`\x82\xAA\x93K\x97p\x82\xB3\x82\xEA\x82Ă\xA2\x82邩\x82\xF0\x8Am\x94F\x82\xB7\x82\xE9
+echo OpenSSL 1.1.1\x82Ƀp\x83b\x83`\x82\xAA\x93K\x97p\x82\xB3\x82\xEA\x82Ă\xA2\x82邩\x82\xF0\x8Am\x94F\x82\xB5\x82܂\xB7...
+echo.
 rem
 
+rem \x83p\x83b\x83`\x83R\x83}\x83\x93\x83h\x82̑\xB6\x8D݃`\x83F\x83b\x83N
+set patchcmd="patch.exe"
+if exist %patchcmd% (goto cmd_true) else goto cmd_false
+
+:cmd_true
+
+
+rem \x83p\x83b\x83`\x82̓K\x97p\x97L\x96\xB3\x82\xF0\x83`\x83F\x83b\x83N
+:patch1
 findstr /c:"# undef AI_PASSIVE" ..\openssl\crypto\bio\bio_lcl.h
-if ERRORLEVEL 1 goto fail
+if ERRORLEVEL 1 goto fail1
+goto patch2
+:fail1
+pushd ..
+%folder%\patch %cmdopt1% < %folder%\ws2_32_dll_patch.txt
+%folder%\patch %cmdopt2% < %folder%\ws2_32_dll_patch.txt
+popd
 
+:patch2
 findstr /c:"running on Windows95" ..\openssl\crypto\threads_win.c
-if ERRORLEVEL 1 goto fail
+if ERRORLEVEL 1 goto fail2
+goto patch3
+:fail2
+pushd ..
+%folder%\patch %cmdopt1% < %folder%\InitializeCriticalSectionAndSpinCount_patch.txt
+%folder%\patch %cmdopt2% < %folder%\InitializeCriticalSectionAndSpinCount_patch.txt
+popd
 
+
+
+:patch3
 echo "\x83p\x83b\x83`\x82͓K\x97p\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB7"
 timeout 5
 goto end
 
-:fail
+:patchfail
 echo "\x83p\x83b\x83`\x82\xAA\x93K\x97p\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2\x82悤\x82ł\xB7"
 set /P ANS="\x91\xB1\x8Ds\x82\xB5\x82܂\xB7\x82\xA9\x81H(y/n)"
 if "%ANS%"=="y" (
@@ -26,6 +56,15 @@
   goto fail
 )
 
+goto end
+
+:cmd_false
+echo \x83p\x83b\x83`\x83R\x83}\x83\x93\x83h %patchcmd% \x82\xAA\x8C\xA9\x82‚\xA9\x82\xE8\x82܂\xB9\x82\xF1
+echo \x89\xBA\x8BL\x83T\x83C\x83g\x82\xA9\x82\xE7\x83_\x83E\x83\x93\x83\x8D\x81[\x83h\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2
+echo http://geoffair.net/projects/patch.htm
+echo.
+exit /b
+
 :end
 @echo on
 

Modified: branches/openssl_1_1_1_v2/libs/openssl_patch/ws2_32_dll_patch.txt
===================================================================
--- branches/openssl_1_1_1_v2/libs/openssl_patch/ws2_32_dll_patch.txt	2019-07-07 14:13:50 UTC (rev 7832)
+++ branches/openssl_1_1_1_v2/libs/openssl_patch/ws2_32_dll_patch.txt	2019-07-08 01:56:43 UTC (rev 7833)
@@ -1,13 +1,14 @@
-diff -cwrp openssl-1.1.1c/crypto/bio/bio_lcl.h openssl/crypto/bio/bio_lcl.h
-*** openssl-1.1.1c/crypto/bio/bio_lcl.h	2019-05-28 22:12:20.000000000 +0900
---- openssl/crypto/bio/bio_lcl.h	2019-06-26 19:48:45.072802700 +0900
+*** openssl-1.1.1c.org/crypto/bio/bio_lcl.h	2019-05-28 22:12:20.000000000 +0900
+--- openssl/crypto/bio/bio_lcl.h	2019-07-07 22:38:36.692285800 +0900
 ***************
 *** 11,16 ****
---- 11,18 ----
+--- 11,19 ----
   #include "internal/sockets.h"
   #include "internal/refcount.h"
   
 + # undef AI_PASSIVE
 + 
++ 
   /* BEGIN BIO_ADDRINFO/BIO_ADDR stuff. */
   
+  #ifndef OPENSSL_NO_SOCK


Ttssh2-commit メーリングリストの案内