From 2f477ae2728d0ed1462508692e09b8f3c8398d90 Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 6 Sep 2024 09:57:32 +0000 Subject: Reenable AES-NI in libcrypto The OPENSSL_cpu_caps() change after the last bump missed a crucial bit: there is more MD mess in the MI code than anticipated, with the result that AES is now used without AES-NI on amd64 and i386, hurting machines that previously greatly benefitted from it. Temporarily add an internal crypto_cpu_caps_ia32() API that returns the OPENSSL_ia32cap_P or 0 like OPENSSL_cpu_caps() previously did. This can be improved after the release. Regression reported and fix tested by Mark Patruck. No impact on public ABI or API. with/ok jsing PS: Next time my pkg_add feels very slow, I should perhaps not mechanically blame IEEE 802.11... --- src/lib/libcrypto/cryptlib.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/cryptlib.c') diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index d929b0daaa..59e6456bbb 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.53 2024/08/31 12:43:58 jsing Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.54 2024/09/06 09:57:32 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -334,6 +334,12 @@ CRYPTO_THREADID_hash(const CRYPTO_THREADID *id) uint64_t OPENSSL_ia32cap_P; +uint64_t +crypto_cpu_caps_ia32(void) +{ + return OPENSSL_ia32cap_P; +} + #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) #define OPENSSL_CPUID_SETUP void @@ -352,6 +358,12 @@ OPENSSL_cpuid_setup(void) } #endif +#else +uint64_t +crypto_cpu_caps_ia32(void) +{ + return 0; +} #endif #if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) -- cgit v1.2.3-55-g6feb