Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Rename System.Security.Cryptography.Native.OpenSsl on Android #52406

Merged
merged 13 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
<PlatformManifestFileEntry Include="libSystem.Net.Security.Native.so" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.Apple.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.Apple.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.Android.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.Android.so" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.OpenSsl.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.OpenSsl.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Security.Cryptography.Native.OpenSsl.so" IsNative="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ internal static partial class Interop
internal static partial class Libraries
{
internal const string Liblog = "liblog";
internal const string CryptoNative = "libSystem.Security.Cryptography.Native.Android";
}
}
10 changes: 10 additions & 0 deletions src/libraries/Common/src/Interop/Unix/Interop.CryptoNative.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

internal static partial class Interop
{
internal static partial class Libraries
{
internal const string CryptoNative = "libSystem.Security.Cryptography.Native.OpenSsl";
}
}
1 change: 0 additions & 1 deletion src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ internal static partial class Libraries
// Shims
internal const string SystemNative = "libSystem.Native";
internal const string NetSecurityNative = "libSystem.Net.Security.Native";
internal const string CryptoNative = "libSystem.Security.Cryptography.Native.OpenSsl";
internal const string CompressionNative = "libSystem.IO.Compression.Native";
internal const string GlobalizationNative = "libSystem.Globalization.Native";
internal const string IOPortsNative = "libSystem.IO.Ports.Native";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ target_link_libraries(System.Security.Cryptography.Native.Android
)

# TODO: Use "System.Security.Cryptography.Native.Android" name (will require a lot of csproj changes here and there)
set_target_properties(System.Security.Cryptography.Native.Android PROPERTIES OUTPUT_NAME "System.Security.Cryptography.Native.OpenSsl")
set_target_properties(System.Security.Cryptography.Native.Android-Static PROPERTIES OUTPUT_NAME "System.Security.Cryptography.Native.OpenSsl")
set_target_properties(System.Security.Cryptography.Native.Android PROPERTIES OUTPUT_NAME "System.Security.Cryptography.Native.Android")
set_target_properties(System.Security.Cryptography.Native.Android-Static PROPERTIES OUTPUT_NAME "System.Security.Cryptography.Native.Android")

install_with_stripped_symbols (System.Security.Cryptography.Native.Android PROGRAMS .)
install (TARGETS System.Security.Cryptography.Native.Android-Static DESTINATION .)
2 changes: 2 additions & 0 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@
Link="Common\Interop\Unix\Interop.IOErrors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.CryptoNative.cs"
Link="Common\Interop\Unix\Interop.CryptoNative.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Open.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@
<Compile Include="System\Net\Security\StreamSizes.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Unix.cs"
Link="Common\System\Net\Security\CertificateValidation.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.CryptoNative.cs"
Link="Common\Interop\Unix\Interop.CryptoNative.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs"
Expand Down Expand Up @@ -346,6 +348,8 @@
Link="Common\System\Net\Security\Unix\SafeFreeSslCredentials.cs" />
</ItemGroup>
<ItemGroup Condition="'$(UseAndroidCrypto)' == 'true'">
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs"
Link="Common\Interop\Android\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Android\Interop.JObjectLifetime.cs"
Link="Common\Interop\Android\Interop.JObjectLifetime.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@
Link="Common\System\Security\Cryptography\ECOpenSsl.cs" />
<Compile Include="$(CommonPath)System\Security\Cryptography\ECOpenSsl.ImportExport.cs"
Link="Common\System\Security\Cryptography\ECOpenSsl.ImportExport.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.CryptoNative.cs"
Link="Common\Interop\Unix\Interop.CryptoNative.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Bignum.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Bignum.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.ImportExport.cs"
Expand Down Expand Up @@ -642,6 +644,8 @@
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(UseAndroidCrypto)' == 'true'">
<Compile Include="$(CommonPath)Interop\Android\Interop.JObjectLifetime.cs"
Link="Common\Interop\Android\Interop.JObjectLifetime.cs" />
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs"
Link="Common\Interop\Android\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Bignum.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.Bignum.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Dsa.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@
<Compile Include="Internal\Cryptography\Pal.Unix\X509Persistence.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.CryptoNative.cs"
Link="Common\Interop\Unix\Interop.CryptoNative.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Permissions.cs"
Expand Down Expand Up @@ -406,6 +408,8 @@
<Compile Include="Internal\Cryptography\Pal.Unix\UnsupportedDisallowedStore.cs" />
<Compile Include="$(CommonPath)Internal\Cryptography\AsymmetricAlgorithmHelpers.Hash.cs"
Link="Common\Internal\Cryptography\AsymmetricAlgorithmHelpers.Hash.cs" />
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs"
Link="Common\Interop\Android\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Android\Interop.JObjectLifetime.cs"
Link="Common\Interop\Android\Interop.JObjectLifetime.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Bignum.cs"
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/pretest.proj
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

<Target Name="GetSharedFrameworkRuntimeFiles">
<ItemGroup>
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.OpenSsl.so" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.Android.so" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.Apple.dylib" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.OpenSsl.dylib" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.Android.dylib" />
<SharedFrameworkRuntimeFile Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*;
$(MicrosoftNetCoreAppRuntimePackNativeDir)*;
@(ManualRuntimePackNativeFile->'$(MicrosoftNetCoreAppRuntimePackNativeDir)%(Identity)')"
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/AndroidAppBuilder/Templates/MonoRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MonoRunner extends Instrumentation
{
static {
// loadLibrary triggers JNI_OnLoad in these libs
System.loadLibrary("System.Security.Cryptography.Native.OpenSsl");
System.loadLibrary("System.Security.Cryptography.Native.Android");
System.loadLibrary("monodroid");
}

Expand Down