summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cryptlib.c
diff options
context:
space:
mode:
authortb <>2024-09-06 09:57:32 +0000
committertb <>2024-09-06 09:57:32 +0000
commit2f477ae2728d0ed1462508692e09b8f3c8398d90 (patch)
treec22e39e94e81983bcd1b3626eb8f8209d4c33a03 /src/lib/libcrypto/cryptlib.c
parent1cf5f5e953944e829c982d02e497cddf8a7ed9c4 (diff)
downloadopenbsd-2f477ae2728d0ed1462508692e09b8f3c8398d90.tar.gz
openbsd-2f477ae2728d0ed1462508692e09b8f3c8398d90.tar.bz2
openbsd-2f477ae2728d0ed1462508692e09b8f3c8398d90.zip
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...
Diffstat (limited to 'src/lib/libcrypto/cryptlib.c')
-rw-r--r--src/lib/libcrypto/cryptlib.c14
1 files changed, 13 insertions, 1 deletions
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 @@
1/* $OpenBSD: cryptlib.c,v 1.53 2024/08/31 12:43:58 jsing Exp $ */ 1/* $OpenBSD: cryptlib.c,v 1.54 2024/09/06 09:57:32 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -334,6 +334,12 @@ CRYPTO_THREADID_hash(const CRYPTO_THREADID *id)
334 334
335uint64_t OPENSSL_ia32cap_P; 335uint64_t OPENSSL_ia32cap_P;
336 336
337uint64_t
338crypto_cpu_caps_ia32(void)
339{
340 return OPENSSL_ia32cap_P;
341}
342
337#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) 343#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM)
338#define OPENSSL_CPUID_SETUP 344#define OPENSSL_CPUID_SETUP
339void 345void
@@ -352,6 +358,12 @@ OPENSSL_cpuid_setup(void)
352} 358}
353#endif 359#endif
354 360
361#else
362uint64_t
363crypto_cpu_caps_ia32(void)
364{
365 return 0;
366}
355#endif 367#endif
356 368
357#if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) 369#if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ)