diff options
author | jsing <> | 2024-08-31 12:43:58 +0000 |
---|---|---|
committer | jsing <> | 2024-08-31 12:43:58 +0000 |
commit | 4d860a7d33bdb05e5782330d5085fda5e809bd72 (patch) | |
tree | ce0f04393328694fbea716953d4d7ed39d8db04c /src/lib/libcrypto/crypto.h | |
parent | 2049348fa6a328167273a9ddbd4a308041e0fe16 (diff) | |
download | openbsd-4d860a7d33bdb05e5782330d5085fda5e809bd72.tar.gz openbsd-4d860a7d33bdb05e5782330d5085fda5e809bd72.tar.bz2 openbsd-4d860a7d33bdb05e5782330d5085fda5e809bd72.zip |
Make OPENSSL_cpu_caps() machine independent.
OPENSSL_cpu_caps() is currently machine dependent and exposes CPUID data
on amd64 and i386. However, what it is really used for is to indicate
whether specific algorithms are accelerated on the given hardware. Change
OPENSSL_cpu_caps() so that it returns a machine indepent value, which
decouples it from amd64/i386 and will allow it to be used appropriately
on other platforms in the future.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/crypto.h')
-rw-r--r-- | src/lib/libcrypto/crypto.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h index 40d3a43f4f..bcca5a0ace 100644 --- a/src/lib/libcrypto/crypto.h +++ b/src/lib/libcrypto/crypto.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto.h,v 1.74 2024/04/10 15:13:23 beck Exp $ */ | 1 | /* $OpenBSD: crypto.h,v 1.75 2024/08/31 12:43:58 jsing 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 | * |
@@ -373,8 +373,6 @@ __attribute__((__noreturn__)) | |||
373 | void OpenSSLDie(const char *file, int line, const char *assertion); | 373 | void OpenSSLDie(const char *file, int line, const char *assertion); |
374 | #define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) | 374 | #define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) |
375 | 375 | ||
376 | uint64_t OPENSSL_cpu_caps(void); | ||
377 | |||
378 | int FIPS_mode(void); | 376 | int FIPS_mode(void); |
379 | int FIPS_mode_set(int r); | 377 | int FIPS_mode_set(int r); |
380 | 378 | ||
@@ -423,6 +421,13 @@ int OPENSSL_init_crypto(uint64_t opts, const void *settings); | |||
423 | void OPENSSL_cleanup(void); | 421 | void OPENSSL_cleanup(void); |
424 | 422 | ||
425 | /* | 423 | /* |
424 | * CPU capabilities. | ||
425 | */ | ||
426 | #define CRYPTO_CPU_CAPS_ACCELERATED_AES 0x00000001ULL | ||
427 | |||
428 | uint64_t OPENSSL_cpu_caps(void); | ||
429 | |||
430 | /* | ||
426 | * OpenSSL helpfully put OPENSSL_gmtime() here because all other time related | 431 | * OpenSSL helpfully put OPENSSL_gmtime() here because all other time related |
427 | * functions are in asn1.h. | 432 | * functions are in asn1.h. |
428 | */ | 433 | */ |