2024-09-27 09:07:54 +02:00
|
|
|
From 11e8f6d75aa73cfab17345f42678d4df3c2a4053 Mon Sep 17 00:00:00 2001
|
2023-01-04 13:38:02 +01:00
|
|
|
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
|
|
|
Date: Thu, 5 Jan 2023 15:47:55 +0100
|
|
|
|
Subject: [PATCH] Hackfix to disable HW acceleration for MD5/SHA1 on x86
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
This causes a direct segfault with musl libc.
|
|
|
|
|
|
|
|
See: http://lists.busybox.net/pipermail/busybox/2023-January/090078.html
|
|
|
|
---
|
|
|
|
libbb/hash_md5_sha.c | 6 +++---
|
2024-09-27 09:07:54 +02:00
|
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
2023-01-04 13:38:02 +01:00
|
|
|
|
|
|
|
diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
|
2024-09-27 09:07:54 +02:00
|
|
|
index 57a801459..96e9731c4 100644
|
2023-01-04 13:38:02 +01:00
|
|
|
--- a/libbb/hash_md5_sha.c
|
|
|
|
+++ b/libbb/hash_md5_sha.c
|
|
|
|
@@ -14,7 +14,7 @@
|
|
|
|
#define NEED_SHA512 (ENABLE_SHA512SUM || ENABLE_USE_BB_CRYPT_SHA)
|
|
|
|
|
|
|
|
#if ENABLE_SHA1_HWACCEL || ENABLE_SHA256_HWACCEL
|
|
|
|
-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
|
|
|
+# if defined(__GNUC__) && defined(__x86_64__)
|
2024-09-27 09:07:54 +02:00
|
|
|
static void cpuid_eax_ebx_ecx(unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
|
2023-01-04 13:38:02 +01:00
|
|
|
{
|
|
|
|
asm ("cpuid"
|
2024-09-27 09:07:54 +02:00
|
|
|
@@ -1191,7 +1191,7 @@ void FAST_FUNC sha1_begin(sha1_ctx_t *ctx)
|
2023-01-04 13:38:02 +01:00
|
|
|
ctx->total64 = 0;
|
|
|
|
ctx->process_block = sha1_process_block64;
|
|
|
|
#if ENABLE_SHA1_HWACCEL
|
|
|
|
-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
|
|
|
+# if defined(__GNUC__) && defined(__x86_64__)
|
|
|
|
{
|
2024-09-27 09:07:54 +02:00
|
|
|
int ni = shaNI;
|
|
|
|
if (!ni)
|
|
|
|
@@ -1243,7 +1243,7 @@ void FAST_FUNC sha256_begin(sha256_ctx_t *ctx)
|
2023-01-04 13:38:02 +01:00
|
|
|
/*ctx->total64 = 0; - done by prepending two 32-bit zeros to init256 */
|
|
|
|
ctx->process_block = sha256_process_block64;
|
|
|
|
#if ENABLE_SHA256_HWACCEL
|
|
|
|
-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
|
|
|
+# if defined(__GNUC__) && defined(__x86_64__)
|
|
|
|
{
|
2024-09-27 09:07:54 +02:00
|
|
|
int ni = shaNI;
|
|
|
|
if (!ni)
|