Update for OPENSSL_cpu_caps() now being machine independent.
authorjsing <jsing@openbsd.org>
Sat, 31 Aug 2024 12:46:55 +0000 (12:46 +0000)
committerjsing <jsing@openbsd.org>
Sat, 31 Aug 2024 12:46:55 +0000 (12:46 +0000)
ok tb@

lib/libssl/ssl_ciph.c

index aba8fbd..8f7345f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_ciph.c,v 1.148 2024/08/31 10:51:48 tb Exp $ */
+/* $OpenBSD: ssl_ciph.c,v 1.149 2024/08/31 12:46:55 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -1112,11 +1112,7 @@ ssl_cipher_process_rulestr(const char *rule_str, CIPHER_ORDER **head_p,
 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;
 }
 
 STACK_OF(SSL_CIPHER) *