summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2015-09-13 10:02:50 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2015-09-13 10:02:50 +0000
commit60772bca2b447340b2d39960609d97449e055629 (patch)
tree58015ae60e6f79176f3e3e9865b8d959fd0327a5
parent921ecfc17185c6c187819784c19ace189b3af3f5 (diff)
Add a new interface, OPENSSL_cpu_caps(), to return the currently running
cpu's specific hardware capabilities users of libcrypto might be interested in, as an integer value. This deprecates the existing OPENSSL_ia32cap() macro and the OPENSSL_ia32cap_loc() function (which returns the pointer so that you can mess with stuff you shouldn't mess with). Interpreting the value returned by OPENSSL_cpu_caps() is, of course, machine-dependent. Minor version bump for libcrypto. ok beck@ jsing@
-rw-r--r--lib/libcrypto/cryptlib.c14
-rw-r--r--lib/libcrypto/crypto.h5
-rw-r--r--lib/libcrypto/shlib_version2
3 files changed, 18 insertions, 3 deletions
diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c
index 896e3d39cfc..fff59f2dfd2 100644
--- a/lib/libcrypto/cryptlib.c
+++ b/lib/libcrypto/cryptlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptlib.c,v 1.35 2015/06/27 22:42:02 doug Exp $ */
+/* $OpenBSD: cryptlib.c,v 1.36 2015/09/13 10:02:49 miod Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -641,6 +641,12 @@ OPENSSL_ia32cap_loc(void)
return (unsigned long *)OPENSSL_ia32cap_P;
}
+uint64_t
+OPENSSL_cpu_caps(void)
+{
+ return *(uint64_t *)OPENSSL_ia32cap_P;
+}
+
#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
#define OPENSSL_CPUID_SETUP
typedef unsigned long long IA32CAP;
@@ -673,6 +679,12 @@ OPENSSL_ia32cap_loc(void)
{
return NULL;
}
+
+uint64_t
+OPENSSL_cpu_caps(void)
+{
+ return 0;
+}
#endif
#if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ)
diff --git a/lib/libcrypto/crypto.h b/lib/libcrypto/crypto.h
index 612b390f276..f53b858d197 100644
--- a/lib/libcrypto/crypto.h
+++ b/lib/libcrypto/crypto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.h,v 1.37 2015/09/10 16:35:15 jsing Exp $ */
+/* $OpenBSD: crypto.h,v 1.38 2015/09/13 10:02:49 miod Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -496,6 +496,9 @@ void OpenSSLDie(const char *file, int line, const char *assertion);
unsigned long *OPENSSL_ia32cap_loc(void);
#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
+
+uint64_t OPENSSL_cpu_caps(void);
+
int OPENSSL_isservice(void);
void OPENSSL_init(void);
diff --git a/lib/libcrypto/shlib_version b/lib/libcrypto/shlib_version
index db69fac89e4..7d59659df12 100644
--- a/lib/libcrypto/shlib_version
+++ b/lib/libcrypto/shlib_version
@@ -1,3 +1,3 @@
# Don't forget to give libssl and libtls the same type of bump!
major=35
-minor=0
+minor=1