mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)
The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804. This PR also prevents making calls that are now unsafe without uplink, and updates the tests to property interpret these failures as unsupported.
This commit is contained in:
parent
ce77da5871
commit
d260631be0
12 changed files with 74 additions and 53 deletions
|
@ -99,9 +99,6 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Modules\_ssl.c" />
|
||||
<ClCompile Include="$(opensslIncludeDir)\applink.c">
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\PC\python_nt.rc" />
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
<ClCompile Include="..\Modules\_ssl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(opensslIncludeDir)\applink.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\PC\python_nt.rc">
|
||||
|
|
|
@ -53,7 +53,7 @@ echo.Fetching external libraries...
|
|||
set libraries=
|
||||
set libraries=%libraries% bzip2-1.0.8
|
||||
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.4
|
||||
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.15
|
||||
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.16
|
||||
set libraries=%libraries% mpdecimal-4.0.0
|
||||
set libraries=%libraries% sqlite-3.45.3.0
|
||||
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.15.0
|
||||
|
@ -77,7 +77,7 @@ echo.Fetching external binaries...
|
|||
|
||||
set binaries=
|
||||
if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.4
|
||||
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.0.15
|
||||
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.0.16.1
|
||||
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.15.0
|
||||
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06
|
||||
|
||||
|
|
|
@ -67,47 +67,23 @@
|
|||
set VCINSTALLDIR=$(VCInstallDir)
|
||||
if not exist "$(IntDir.TrimEnd('\'))" mkdir "$(IntDir.TrimEnd('\'))"
|
||||
cd /D "$(IntDir.TrimEnd('\'))"
|
||||
$(Perl) "$(opensslDir)\configure" $(OpenSSLPlatform) no-asm
|
||||
$(Perl) "$(opensslDir)\configure" $(OpenSSLPlatform) no-asm no-uplink
|
||||
nmake
|
||||
</NMakeBuildCommandLine>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
<Target Name="_PatchUplink" BeforeTargets="Build">
|
||||
<PropertyGroup>
|
||||
<Uplink>$(opensslDir)\ms\uplink.c</Uplink>
|
||||
<BeforePatch>((h = GetModuleHandle(NULL)) == NULL)</BeforePatch>
|
||||
<AfterPatch>((h = GetModuleHandleA("_ssl.pyd")) == NULL) if ((h = GetModuleHandleA("_ssl_d.pyd")) == NULL) if ((h = GetModuleHandle(NULL)) == NULL /*patched*/)</AfterPatch>
|
||||
</PropertyGroup>
|
||||
<Error Text="Cannot find $(Uplink)" Condition="!Exists($(Uplink))" />
|
||||
<PropertyGroup>
|
||||
<_Original>$([System.IO.File]::ReadAllText($(Uplink)))</_Original>
|
||||
<_Patched>$(_Original.Replace($(BeforePatch), $(AfterPatch)))</_Patched>
|
||||
<IsPatched>false</IsPatched>
|
||||
<IsPatched Condition="$(_Patched) == $(_Original)">true</IsPatched>
|
||||
</PropertyGroup>
|
||||
<Message Text="$(Uplink) is already patched" Importance="normal" Condition="$(IsPatched)" />
|
||||
<Message Text="Patching $(Uplink)" Importance="high" Condition="!$(IsPatched)" />
|
||||
<WriteLinesToFile File="$(Uplink)"
|
||||
Lines="$(_Patched)"
|
||||
Overwrite="true"
|
||||
Encoding="ASCII"
|
||||
Condition="!$(IsPatched)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_CopyToOutput" AfterTargets="Build">
|
||||
<ItemGroup>
|
||||
<_Built Include="$(opensslDir)\LICENSE" />
|
||||
<_Built Include="$(IntDir)\libcrypto.lib;$(IntDir)\libcrypto-*.dll;$(IntDir)\libcrypto-*.pdb" />
|
||||
<_Built Include="$(IntDir)\libssl.lib;$(IntDir)\libssl-*.dll;$(IntDir)\libssl-*.pdb" />
|
||||
<_AppLink Include="$(opensslDir)\ms\applink.c" />
|
||||
<_Include Include="$(opensslDir)\Include\openssl\*.h" />
|
||||
<_Include Include="$(IntDir)\include\openssl\*.h" />
|
||||
</ItemGroup>
|
||||
<MakeDir Directories="$(opensslOutDir)\include\openssl" />
|
||||
<Copy SourceFiles="@(_Built)" DestinationFolder="$(opensslOutDir)" />
|
||||
<Copy SourceFiles="@(_AppLink)" DestinationFolder="$(opensslOutDir)\include" />
|
||||
<Copy SourceFiles="@(_Include)" DestinationFolder="$(opensslOutDir)\include\openssl" />
|
||||
</Target>
|
||||
|
||||
|
|
|
@ -81,8 +81,8 @@
|
|||
<libffiOutDir Condition="$(libffiOutDir) == ''">$(libffiDir)$(ArchName)\</libffiOutDir>
|
||||
<libffiIncludeDir Condition="$(libffiIncludeDir) == ''">$(libffiOutDir)include</libffiIncludeDir>
|
||||
<mpdecimalDir Condition="$(mpdecimalDir) == ''">$(ExternalsDir)\mpdecimal-4.0.0\</mpdecimalDir>
|
||||
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-3.0.15\</opensslDir>
|
||||
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-3.0.15\$(ArchName)\</opensslOutDir>
|
||||
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-3.0.16\</opensslDir>
|
||||
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-3.0.16.1\$(ArchName)\</opensslOutDir>
|
||||
<opensslIncludeDir Condition="$(opensslIncludeDir) == ''">$(opensslOutDir)include</opensslIncludeDir>
|
||||
<nasmDir Condition="$(nasmDir) == ''">$(ExternalsDir)\nasm-2.11.06\</nasmDir>
|
||||
<zlibDir Condition="$(zlibDir) == ''">$(ExternalsDir)\zlib-1.3.1\</zlibDir>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue