diff options
| author | tb <> | 2024-09-06 09:57:32 +0000 |
|---|---|---|
| committer | tb <> | 2024-09-06 09:57:32 +0000 |
| commit | de922e906737ea318d3a84723ec68b62581dd51c (patch) | |
| tree | c22e39e94e81983bcd1b3626eb8f8209d4c33a03 /src/lib/libcrypto/cryptlib.c | |
| parent | 546fb2f18abf0a6a44cd70ba838da81736c4583a (diff) | |
| download | openbsd-de922e906737ea318d3a84723ec68b62581dd51c.tar.gz openbsd-de922e906737ea318d3a84723ec68b62581dd51c.tar.bz2 openbsd-de922e906737ea318d3a84723ec68b62581dd51c.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.c | 14 |
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 | ||
| 335 | uint64_t OPENSSL_ia32cap_P; | 335 | uint64_t OPENSSL_ia32cap_P; |
| 336 | 336 | ||
| 337 | uint64_t | ||
| 338 | crypto_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 |
| 339 | void | 345 | void |
| @@ -352,6 +358,12 @@ OPENSSL_cpuid_setup(void) | |||
| 352 | } | 358 | } |
| 353 | #endif | 359 | #endif |
| 354 | 360 | ||
| 361 | #else | ||
| 362 | uint64_t | ||
| 363 | crypto_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) |
