From: jsing Date: Sat, 31 Aug 2024 12:47:24 +0000 (+0000) Subject: Update for OPENSSL_cpu_caps() now being machine independent. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a75d20e9016c589fdb3065e4bed83101c6167e79;p=openbsd Update for OPENSSL_cpu_caps() now being machine independent. --- diff --git a/regress/lib/libssl/ciphers/cipherstest.c b/regress/lib/libssl/ciphers/cipherstest.c index 649eaf72006..1df335f9f21 100644 --- a/regress/lib/libssl/ciphers/cipherstest.c +++ b/regress/lib/libssl/ciphers/cipherstest.c @@ -30,11 +30,7 @@ int ssl_parse_ciphersuites(STACK_OF(SSL_CIPHER) **out_ciphers, const char *str); static inline int ssl_aes_is_accelerated(void) { -#if defined(__i386__) || defined(__x86_64__) - return ((OPENSSL_cpu_caps() & (1ULL << 57)) != 0); -#else - return (0); -#endif + return (OPENSSL_cpu_caps() & CRYPTO_CPU_CAPS_ACCELERATED_AES) != 0; } static int diff --git a/regress/lib/libssl/client/clienttest.c b/regress/lib/libssl/client/clienttest.c index 0c526f38f81..7e96944fcec 100644 --- a/regress/lib/libssl/client/clienttest.c +++ b/regress/lib/libssl/client/clienttest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clienttest.c,v 1.44 2024/07/20 18:37:38 tb Exp $ */ +/* $OpenBSD: clienttest.c,v 1.45 2024/08/31 12:47:24 jsing Exp $ */ /* * Copyright (c) 2015 Joel Sing * @@ -515,11 +515,7 @@ hexdump(const uint8_t *buf, size_t len, const uint8_t *compare) static inline int ssl_aes_is_accelerated(void) { -#if defined(__i386__) || defined(__x86_64__) - return ((OPENSSL_cpu_caps() & (1ULL << 57)) != 0); -#else - return (0); -#endif + return (OPENSSL_cpu_caps() & CRYPTO_CPU_CAPS_ACCELERATED_AES) != 0; } static int diff --git a/regress/lib/libssl/unit/ssl_get_shared_ciphers.c b/regress/lib/libssl/unit/ssl_get_shared_ciphers.c index ff966900aa4..e26f614e536 100644 --- a/regress/lib/libssl/unit/ssl_get_shared_ciphers.c +++ b/regress/lib/libssl/unit/ssl_get_shared_ciphers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_get_shared_ciphers.c,v 1.12 2024/03/20 10:38:05 jsing Exp $ */ +/* $OpenBSD: ssl_get_shared_ciphers.c,v 1.13 2024/08/31 12:47:24 jsing Exp $ */ /* * Copyright (c) 2021 Theo Buehler * @@ -379,11 +379,7 @@ shutdown_peers(SSL *client_ssl, SSL *server_ssl, const char *description) static inline int ssl_aes_is_accelerated(void) { -#if defined(__i386__) || defined(__x86_64__) - return ((OPENSSL_cpu_caps() & (1ULL << 57)) != 0); -#else - return (0); -#endif + return (OPENSSL_cpu_caps() & CRYPTO_CPU_CAPS_ACCELERATED_AES) != 0; } static int