[openssl] Fix arm-neon-android asm (#33955)

Follow-up from #33890, tentative arm-neon-android asm patch.

Patch submitted upstream: https://github.com/openssl/openssl/pull/22181,
tagged "severity: fips change".
This commit is contained in:
Kai Pastor 2024-06-28 23:51:23 +02:00 committed by GitHub
parent e3ad383ceb
commit db0f4e665e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 105 additions and 3 deletions

View File

@ -0,0 +1,96 @@
diff --git a/crypto/armv4cpuid.pl b/crypto/armv4cpuid.pl
index 04b342551c..9b933c70c4 100644
--- a/crypto/armv4cpuid.pl
+++ b/crypto/armv4cpuid.pl
@@ -293,6 +293,7 @@ atomic_add_spinlock:
#endif
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
___
print $code;
diff --git a/crypto/bn/asm/armv4-gf2m.pl b/crypto/bn/asm/armv4-gf2m.pl
index 17af0e0774..5733a01746 100644
--- a/crypto/bn/asm/armv4-gf2m.pl
+++ b/crypto/bn/asm/armv4-gf2m.pl
@@ -326,6 +326,7 @@ $code.=<<___;
#if __ARM_MAX_ARCH__>=7
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___
diff --git a/crypto/bn/asm/armv4-mont.pl b/crypto/bn/asm/armv4-mont.pl
index d85da92406..6e839d845c 100644
--- a/crypto/bn/asm/armv4-mont.pl
+++ b/crypto/bn/asm/armv4-mont.pl
@@ -750,6 +750,7 @@ $code.=<<___;
.align 2
#if __ARM_MAX_ARCH__>=7
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___
diff --git a/crypto/chacha/asm/chacha-armv4.pl b/crypto/chacha/asm/chacha-armv4.pl
index ac32d5bda7..bb48b6eeb9 100755
--- a/crypto/chacha/asm/chacha-armv4.pl
+++ b/crypto/chacha/asm/chacha-armv4.pl
@@ -1155,6 +1155,7 @@ $code.=<<___;
ldmia sp!,{r4-r11,pc}
.size ChaCha20_neon,.-ChaCha20_neon
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___
}}}
diff --git a/crypto/poly1305/asm/poly1305-armv4.pl b/crypto/poly1305/asm/poly1305-armv4.pl
index b98beefa18..673ea62ec3 100755
--- a/crypto/poly1305/asm/poly1305-armv4.pl
+++ b/crypto/poly1305/asm/poly1305-armv4.pl
@@ -1240,6 +1240,7 @@ $code.=<<___;
.align 2
#if __ARM_MAX_ARCH__>=7
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___
diff --git a/crypto/sha/asm/sha1-armv4-large.pl b/crypto/sha/asm/sha1-armv4-large.pl
index 2832c5b530..b3a8ec6941 100644
--- a/crypto/sha/asm/sha1-armv4-large.pl
+++ b/crypto/sha/asm/sha1-armv4-large.pl
@@ -708,6 +708,7 @@ ___
$code.=<<___;
#if __ARM_MAX_ARCH__>=7
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___
diff --git a/crypto/sha/asm/sha256-armv4.pl b/crypto/sha/asm/sha256-armv4.pl
index 8bac84b1a8..feb1f26109 100644
--- a/crypto/sha/asm/sha256-armv4.pl
+++ b/crypto/sha/asm/sha256-armv4.pl
@@ -694,6 +694,7 @@ $code.=<<___;
.align 2
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___
diff --git a/crypto/sha/asm/sha512-armv4.pl b/crypto/sha/asm/sha512-armv4.pl
index c8b8110671..9aa310ffd0 100644
--- a/crypto/sha/asm/sha512-armv4.pl
+++ b/crypto/sha/asm/sha512-armv4.pl
@@ -661,6 +661,7 @@ $code.=<<___;
.align 2
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
.extern OPENSSL_armcap_P
+.hidden OPENSSL_armcap_P
#endif
___

View File

@ -16,6 +16,7 @@ vcpkg_from_github(
cmake-config.patch
command-line-length.patch
script-prefix.patch
asm-armcap.patch
windows/install-layout.patch
windows/install-pdbs.patch
unix/android-cc.patch

View File

@ -45,8 +45,7 @@ vcpkg_list(SET MAKEFILE_OPTIONS)
if(VCPKG_TARGET_IS_ANDROID)
set(ENV{ANDROID_NDK_ROOT} "${VCPKG_DETECTED_CMAKE_ANDROID_NDK}")
set(OPENSSL_ARCH "android-${VCPKG_DETECTED_CMAKE_ANDROID_ARCH}")
# asm on arm32 NEON is broken, https://github.com/openssl/openssl/pull/21583#issuecomment-1727057735
if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" #[[AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON]])
if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON)
vcpkg_list(APPEND CONFIGURE_OPTIONS no-asm)
endif()
elseif(VCPKG_TARGET_IS_LINUX)

View File

@ -1,6 +1,7 @@
{
"name": "openssl",
"version": "3.3.1",
"port-version": 1,
"description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.",
"homepage": "https://www.openssl.org",
"license": "Apache-2.0",

View File

@ -6562,7 +6562,7 @@
},
"openssl": {
"baseline": "3.3.1",
"port-version": 0
"port-version": 1
},
"openssl-unix": {
"baseline": "deprecated",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "038ce0eca1d7e3f285a8de86c75bb8b89255994d",
"version": "3.3.1",
"port-version": 1
},
{
"git-tree": "e117c9b91839ae0538b4e9a8d6809aecfa49948a",
"version": "3.3.1",