aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-06-23 14:31:42 -0400
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-06-24 16:29:54 +0000
commit7811fdc94b7ec146937e83f98d411157974ffa32 (patch)
tree6fdb7be65766f4268e2f2a3dc032d2f9b5f51076
parent45db24b36a030ec54464ea7a26c362f3c82305ee (diff)
downloadboringssl-7811fdc94b7ec146937e83f98d411157974ffa32.zip
boringssl-7811fdc94b7ec146937e83f98d411157974ffa32.tar.gz
boringssl-7811fdc94b7ec146937e83f98d411157974ffa32.tar.bz2
Ensure CRYPTO_needs_hwcap2_workaround works without CRYPTO_library_init
There's one place in Chromium that relied on CRYPTO_library_init to have initialized things. We can fix this by simply initializing inside the accessor. Bug: 40644931 Change-Id: Id6c849d350f3db16103dd118659a48710c3d05a3 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/69607 Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
-rw-r--r--crypto/cpu_arm_linux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/cpu_arm_linux.c b/crypto/cpu_arm_linux.c
index e3a2370..dbcd940 100644
--- a/crypto/cpu_arm_linux.c
+++ b/crypto/cpu_arm_linux.c
@@ -143,6 +143,9 @@ void OPENSSL_cpuid_setup(void) {
int CRYPTO_has_broken_NEON(void) { return 0; }
-int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; }
+int CRYPTO_needs_hwcap2_workaround(void) {
+ OPENSSL_init_cpuid();
+ return g_needs_hwcap2_workaround;
+}
#endif // OPENSSL_ARM && OPENSSL_LINUX && !OPENSSL_STATIC_ARMCAP