mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
openssl: SM4 check should be for __aarch64__, not __ARM_MAX_ARCH__ >= 8}
This commit is contained in:
parent
557e80b5f4
commit
e1d2227b5e
57
packages/security/openssl/patches/openssl-0001-pr20624.patch
Normal file
57
packages/security/openssl/patches/openssl-0001-pr20624.patch
Normal file
@ -0,0 +1,57 @@
|
||||
From d6e2c1c3282a5ca1a5846ec974c92bcea52ad838 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Cosgrove <tom.cosgrove@arm.com>
|
||||
Date: Tue, 28 Mar 2023 11:53:37 +0100
|
||||
Subject: [PATCH] SM4 check should be for __aarch64__, not __ARM_MAX_ARCH__ >=
|
||||
8
|
||||
|
||||
(And then __arm__ and __arm tests are redundant)
|
||||
|
||||
Fixes #20604 for 3.1 branch
|
||||
---
|
||||
include/crypto/sm4_platform.h | 24 +++++++++++-------------
|
||||
1 file changed, 11 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/include/crypto/sm4_platform.h b/include/crypto/sm4_platform.h
|
||||
index 11f9b9d88b50..54bbc37df37a 100644
|
||||
--- a/include/crypto/sm4_platform.h
|
||||
+++ b/include/crypto/sm4_platform.h
|
||||
@@ -12,9 +12,8 @@
|
||||
# pragma once
|
||||
|
||||
# if defined(OPENSSL_CPUID_OBJ)
|
||||
-# if (defined(__arm__) || defined(__arm) || defined(__aarch64__))
|
||||
+# if defined(__aarch64__)
|
||||
# include "arm_arch.h"
|
||||
-# if __ARM_MAX_ARCH__>=8
|
||||
extern unsigned int OPENSSL_arm_midr;
|
||||
static inline int vpsm4_capable(void)
|
||||
{
|
||||
@@ -22,18 +21,17 @@ static inline int vpsm4_capable(void)
|
||||
(MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V1) ||
|
||||
MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_N1));
|
||||
}
|
||||
-# if defined(VPSM4_ASM)
|
||||
-# define VPSM4_CAPABLE vpsm4_capable()
|
||||
-# endif
|
||||
-# define HWSM4_CAPABLE (OPENSSL_armcap_P & ARMV8_SM4)
|
||||
-# define HWSM4_set_encrypt_key sm4_v8_set_encrypt_key
|
||||
-# define HWSM4_set_decrypt_key sm4_v8_set_decrypt_key
|
||||
-# define HWSM4_encrypt sm4_v8_encrypt
|
||||
-# define HWSM4_decrypt sm4_v8_decrypt
|
||||
-# define HWSM4_cbc_encrypt sm4_v8_cbc_encrypt
|
||||
-# define HWSM4_ecb_encrypt sm4_v8_ecb_encrypt
|
||||
-# define HWSM4_ctr32_encrypt_blocks sm4_v8_ctr32_encrypt_blocks
|
||||
+# if defined(VPSM4_ASM)
|
||||
+# define VPSM4_CAPABLE vpsm4_capable()
|
||||
# endif
|
||||
+# define HWSM4_CAPABLE (OPENSSL_armcap_P & ARMV8_SM4)
|
||||
+# define HWSM4_set_encrypt_key sm4_v8_set_encrypt_key
|
||||
+# define HWSM4_set_decrypt_key sm4_v8_set_decrypt_key
|
||||
+# define HWSM4_encrypt sm4_v8_encrypt
|
||||
+# define HWSM4_decrypt sm4_v8_decrypt
|
||||
+# define HWSM4_cbc_encrypt sm4_v8_cbc_encrypt
|
||||
+# define HWSM4_ecb_encrypt sm4_v8_ecb_encrypt
|
||||
+# define HWSM4_ctr32_encrypt_blocks sm4_v8_ctr32_encrypt_blocks
|
||||
# endif
|
||||
# endif /* OPENSSL_CPUID_OBJ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user