Skip to content

Commit

Permalink
Bump minimum Apple OS versions (dotnet#101342)
Browse files Browse the repository at this point in the history
As defined in the ".NET 9 - Supported OS versions" document: https://github.com/dotnet/core/blob/main/release-notes/9.0/supported-os.md

- macOS 12.0
- iOS/iOSSimulator 12.2
- tvOS/tvOSSimulator 12.2
- MacCatalyst 15.0 (== macOS 12.0)

Fixes dotnet#91736
  • Loading branch information
akoeplinger authored and michaelgsharp committed May 8, 2024
1 parent b965caf commit 0eca666
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 66 deletions.
14 changes: 9 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,22 @@
- eng/native/configurecompiler.cmake
- eng/native/build-commons.sh
- src/native/libs/build-native.sh
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs
- src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
- src/mono/mono/tools/offsets-tool/offsets-tool.py
- src/mono/msbuild/apple/build/AppleBuild.targets
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml
- src/tasks/AotCompilerTask/MonoAOTCompiler.props
- src/tasks/AppleAppBuilder/Xcode.cs
- src/tasks/MobileBuildTasks/Apple/AppleProject.cs
- dotnet/installer repo > src/redist/targets/GeneratePKG.targets
-->
<AndroidApiLevelMin>21</AndroidApiLevelMin>
<iOSVersionMin>11.0</iOSVersionMin>
<tvOSVersionMin>11.0</tvOSVersionMin>
<macOSVersionMin>10.15</macOSVersionMin>
<macOSVersionMin Condition="('$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst') and '$(TargetArchitecture)' == 'arm64'">11.0</macOSVersionMin>
<iOSVersionMin>12.2</iOSVersionMin>
<tvOSVersionMin>12.2</tvOSVersionMin>
<macOSVersionMin>12.0</macOSVersionMin>
<MacCatalystVersionMin>15.0</MacCatalystVersionMin>
</PropertyGroup>

<PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ build_native()

# set default iOS simulator deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
if [[ "$__TargetArch" == x64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs"
elif [[ "$__TargetArch" == arm64 ]]; then
Expand All @@ -123,7 +123,7 @@ build_native()

# set default iOS device deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
if [[ "$__TargetArch" == arm64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
else
Expand All @@ -135,7 +135,7 @@ build_native()

# set default tvOS simulator deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
if [[ "$__TargetArch" == x64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs"
elif [[ "$__TargetArch" == arm64 ]]; then
Expand All @@ -149,7 +149,7 @@ build_native()

# set default tvOS device deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
if [[ "$__TargetArch" == arm64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
else
Expand Down
20 changes: 13 additions & 7 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)

# "configureoptimization.cmake" must be included after CLR_CMAKE_HOST_UNIX has been set.
include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake)
Expand Down Expand Up @@ -300,7 +301,13 @@ elseif(CLR_CMAKE_HOST_SUNOS)
add_definitions(-D__EXTENSIONS__ -D_XPG4_2 -D_POSIX_PTHREAD_SEMANTICS)
elseif(CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
add_definitions(-D_XOPEN_SOURCE)
add_linker_flag("-Wl,-bind_at_load")

# the new linker in Xcode 15 (ld_new/ld_prime) deprecated the -bind_at_load flag for macOS which causes a warning
# that fails the build since we build with -Werror. Only pass the flag if we need it, i.e. older linkers.
check_linker_flag(C "-Wl,-bind_at_load,-fatal_warnings" LINKER_SUPPORTS_BIND_AT_LOAD_FLAG)
if(LINKER_SUPPORTS_BIND_AT_LOAD_FLAG)
add_linker_flag("-Wl,-bind_at_load")
endif()
elseif(CLR_CMAKE_HOST_HAIKU)
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
add_linker_flag("-Wl,--no-undefined")
Expand Down Expand Up @@ -662,11 +669,11 @@ if (CLR_CMAKE_HOST_UNIX)
set(DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option)
add_link_options(-Wno-overriding-t-option)
if(CLR_CMAKE_HOST_ARCH_ARM64)
set(MACOS_VERSION_MIN_FLAGS "-target arm64-apple-ios14.2-macabi")
add_link_options(-target arm64-apple-ios14.2-macabi)
set(MACOS_VERSION_MIN_FLAGS "-target arm64-apple-ios15.0-macabi")
add_link_options(-target arm64-apple-ios15.0-macabi)
elseif(CLR_CMAKE_HOST_ARCH_AMD64)
set(MACOS_VERSION_MIN_FLAGS "-target x86_64-apple-ios13.5-macabi")
add_link_options(-target x86_64-apple-ios13.5-macabi)
set(MACOS_VERSION_MIN_FLAGS "-target x86_64-apple-ios15.0-macabi")
add_link_options(-target x86_64-apple-ios15.0-macabi)
else()
clr_unknown_arch()
endif()
Expand All @@ -679,11 +686,10 @@ if (CLR_CMAKE_HOST_UNIX)
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}")
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}")
elseif(CLR_CMAKE_HOST_OSX)
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
if(CLR_CMAKE_HOST_ARCH_ARM64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
add_compile_options(-arch arm64)
elseif(CLR_CMAKE_HOST_ARCH_AMD64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
add_compile_options(-arch x86_64)
else()
clr_unknown_arch()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ The .NET Foundation licenses this file to you under the MIT license.
</PropertyGroup>

<PropertyGroup Condition="'$(_IsiOSLikePlatform)' == 'true'">
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst' and '$(_targetArchitecture)' == 'x64'">13.5</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">14.2</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos')))">11.0</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">15.0</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos')))">12.2</AppleMinOSVersion>

<_AppleSdkName Condition="'$(_targetOS)' == 'ios'">iphoneos</_AppleSdkName>
<_AppleSdkName Condition="'$(_targetOS)' == 'iossimulator'">iphonesimulator</_AppleSdkName>
Expand All @@ -96,7 +95,7 @@ The .NET Foundation licenses this file to you under the MIT license.
</PropertyGroup>

<PropertyGroup Condition="'$(_targetOS)' == 'osx'">
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == ''">11.0</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == ''">12.0</AppleMinOSVersion>
<TargetTriple Condition="'$(_targetArchitecture)' == 'x64'">x86_64-apple-macos$(AppleMinOSVersion)</TargetTriple>
<TargetTriple Condition="'$(_targetArchitecture)' == 'arm64'">arm64-apple-macos$(AppleMinOSVersion)</TargetTriple>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,12 @@ private protected override void EmitObjectFile(string objectFilePath)
{
case TargetOS.OSX:
buildVersion.Platform = PLATFORM_MACOS;
buildVersion.MinimumPlatformVersion = 0x0A_0C_00; // 10.12.0
buildVersion.MinimumPlatformVersion = 0x0C_00_00; // 12.0.0
break;

case TargetOS.MacCatalyst:
buildVersion.Platform = PLATFORM_MACCATALYST;
buildVersion.MinimumPlatformVersion = _cpuType switch
{
CPU_TYPE_X86_64 => 0x0D_05_00u, // 13.5.0
_ => 0x0E_02_00u, // 14.2.0
};
buildVersion.MinimumPlatformVersion = 0x0F_02_00; // 15.0.0
break;

case TargetOS.iOS:
Expand All @@ -268,7 +264,7 @@ private protected override void EmitObjectFile(string objectFilePath)
TargetOS.tvOSSimulator => PLATFORM_TVOSSIMULATOR,
_ => 0,
};
buildVersion.MinimumPlatformVersion = 0x0B_00_00; // 11.0.0
buildVersion.MinimumPlatformVersion = 0x0C_02_00; // 12.2.0
break;
}
buildVersion.Write(outputFileStream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<volume-check>
<allowed-os-versions>
<!-- keep in sync with SetOSTargetMinVersions in the root Directory.Build.props -->
<os-version min="11.0" />
<os-version min="12.0" />
</allowed-os-versions>
</volume-check>
</installer-gui-script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<volume-check>
<allowed-os-versions>
<!-- keep in sync with SetOSTargetMinVersions in the root Directory.Build.props -->
<os-version min="10.15" />
<os-version min="12.0" />
</allowed-os-versions>
</volume-check>
</installer-gui-script>
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@

<Target Name="GetAppleBuildArgumentsForDNNE" Condition="'$(_TargetsAppleOS)' == 'true'">
<PropertyGroup Condition=" '$(TargetOS)' == 'maccatalyst'">
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-ios14.2-macabi</TargetTriple>
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-ios13.5-macabi</TargetTriple>
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-ios$(MacCatalystVersionMin)-macabi</TargetTriple>
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-ios$(MacCatalystVersionMin)-macabi</TargetTriple>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'osx'">
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-macos11</TargetTriple>
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-macos10.15</TargetTriple>
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-macos$(macOSVersionMin)</TargetTriple>
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-macos$(macOSVersionMin)</TargetTriple>
<XCodeSdkName>macosx</XCodeSdkName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed partial class AesGcm
{
private FixedMemoryKeyBox _keyBox;

// CryptoKit added AES.GCM in macOS 10.15, which is our minimum target for macOS.
// CryptoKit added AES.GCM in macOS 10.15, which is lower than our minimum target for macOS.
public static bool IsSupported => true;

// CryptoKit only supports 16 byte tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace System.Security.Cryptography
{
public sealed partial class ChaCha20Poly1305
{
// CryptoKit added ChaCha20Poly1305 in macOS 10.15, which is our minimum target for macOS.
// CryptoKit added ChaCha20Poly1305 in macOS 10.15, which is lower than our minimum target for macOS.
public static bool IsSupported => true;
private FixedMemoryKeyBox _keyBox;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public static void CheckIsSupported()
}
else if (PlatformDetection.IsOSX)
{
// CryptoKit is supported on macOS 10.15+, which is our minimum target.
// CryptoKit is supported on macOS 10.15+, which is lower than our minimum target.
expectedIsSupported = true;
}
else if (PlatformDetection.OpenSslPresentOnSystem && PlatformDetection.IsOpenSslSupported)
Expand Down
8 changes: 4 additions & 4 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,11 @@
<_MonoCMakeArgs Include="-DCMAKE_SYSTEM_VARIANT=maccatalyst" />
<!-- https://gitlab.kitware.com/cmake/cmake/-/issues/20132 -->
<_MonoCPPFLAGS Include="-Wno-overriding-t-option" />
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" />
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" />
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios$(MacCatalystVersionMin)-macabi" />
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios$(MacCatalystVersionMin)-macabi" />
<_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" />
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" />
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" />
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios$(MacCatalystVersionMin)-macabi" />
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios$(MacCatalystVersionMin)-macabi" />
<_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" />
<!-- Force running as arm64 even when invoked from an x64 msbuild process -->
<_MonoBuildEnv Condition="'$(BuildArchitecture)' == 'arm64'" Include="arch -arch arm64" />
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/tools/offsets-tool/offsets-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ def require_emscipten_path (args):
elif "x86_64-apple-maccatalyst" == args.abi:
require_sysroot (args)
self.target = Target ("TARGET_AMD64", "TARGET_MACCAT", IOS_DEFINES)
self.target_args += ["-target", "x86_64-apple-ios13.5-macabi"]
self.target_args += ["-target", "x86_64-apple-ios15.0-macabi"]
self.target_args += ["-isysroot", args.sysroot]

elif "aarch64-apple-maccatalyst" == args.abi:
require_sysroot (args)
self.target = Target ("TARGET_ARM64", "TARGET_MACCAT", IOS_DEFINES)
self.target_args += ["-target", "arm64-apple-ios14.2-macabi"]
self.target_args += ["-target", "arm64-apple-ios15.0-macabi"]
self.target_args += ["-isysroot", args.sysroot]

# watchOS
Expand Down
4 changes: 2 additions & 2 deletions src/mono/msbuild/apple/build/AppleBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@

<ItemGroup>
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=arm64-ios" />
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios14.2-macabi" />
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios15.0-macabi" />
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=x86_64-ios" />
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios13.5-macabi" />
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios15.0-macabi" />
<MonoAOTCompilerDefaultAotArguments Include="static" />
<MonoAOTCompilerDefaultAotArguments Include="dwarfdebug" />
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mattr=+crc" /> <!-- enable System.Runtime.Intrinsics.Arm (Crc32 and ArmBase for now) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ static int32_t ExecuteSignTransform(SecTransformRef signer, CFDataRef* pSignatur
assert(pErrorOut != NULL);

int32_t ret = INT_MIN;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CFTypeRef signerResponse = SecTransformExecute(signer, pErrorOut);
#pragma clang diagnostic pop
CFDataRef signature = NULL;

if (signerResponse == NULL || *pErrorOut != NULL)
Expand Down Expand Up @@ -62,7 +65,10 @@ static int32_t ExecuteVerifyTransform(SecTransformRef verifier, CFErrorRef* pErr
assert(pErrorOut != NULL);

int32_t ret = kErrorSeeError;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CFTypeRef verifierResponse = SecTransformExecute(verifier, pErrorOut);
#pragma clang diagnostic pop

if (verifierResponse != NULL)
{
Expand All @@ -79,6 +85,8 @@ static int32_t ExecuteVerifyTransform(SecTransformRef verifier, CFErrorRef* pErr

static int32_t ConfigureSignVerifyTransform(SecTransformRef xform, CFDataRef cfDataHash, CFErrorRef* pErrorOut)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (!SecTransformSetAttribute(xform, kSecInputIsAttributeName, kSecInputIsDigest, pErrorOut))
{
return 0;
Expand All @@ -88,6 +96,7 @@ static int32_t ConfigureSignVerifyTransform(SecTransformRef xform, CFDataRef cfD
{
return 0;
}
#pragma clang diagnostic pop

return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ int32_t AppleCryptoNative_SslIsHostnameMatch(SSLContextRef sslContext, CFStringR

for (CFIndex i = 0; i < certificateCount; i++)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SecCertificateRef item = SecTrustGetCertificateAtIndex(existingTrust, i);
#pragma clang diagnostic pop

CFArrayAppendValue(certs, item);

// Copy the EE cert into the anchors set, this will make the chain part
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,7 @@ AppleCryptoNative_X509GetPublicKey(SecCertificateRef cert, SecKeyRef* pPublicKey
if (cert == NULL || pPublicKeyOut == NULL)
return kErrorUnknownState;

if (__builtin_available(macOS 10.14, iOS 12, tvOS 12, *))
{
*pPublicKeyOut = SecCertificateCopyKey(cert);
}
#if defined(TARGET_IOS) || defined(TARGET_TVOS)
else
{
*pPublicKeyOut = SecCertificateCopyPublicKey(cert);
}
#endif
*pPublicKeyOut = SecCertificateCopyKey(cert);

return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ SecCertificateRef AppleCryptoNative_X509ChainGetCertificateAtIndex(SecTrustRef c
if (chain == NULL || index < 0)
return NULL;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return SecTrustGetCertificateAtIndex(chain, index);
#pragma clang diagnostic pop
}

CFArrayRef AppleCryptoNative_X509ChainGetTrustResults(SecTrustRef chain)
Expand Down
Loading

0 comments on commit 0eca666

Please sign in to comment.