diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-06-20 21:00:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-06-20 21:00:47 +0000 |
commit | e8b5f13f0be16230a5e0a29dd9fef18c8d279e6a (patch) | |
tree | 726d477218b68d5e3e7d2937d675ae9be22131c9 | |
parent | 3a95086d3fdfe5d805d059634af3cb7234d7972c (diff) |
Remove the OPENSSL_*cap getenv's. A program should not be able to
change the behaviour of the library in such a complicated fashion.
ok miod
-rw-r--r-- | lib/libcrypto/armcap.c | 9 | ||||
-rw-r--r-- | lib/libcrypto/cryptlib.c | 14 | ||||
-rw-r--r-- | lib/libcrypto/sparcv9cap.c | 7 |
3 files changed, 5 insertions, 25 deletions
diff --git a/lib/libcrypto/armcap.c b/lib/libcrypto/armcap.c index 330fea25a7e..7ee94d48b12 100644 --- a/lib/libcrypto/armcap.c +++ b/lib/libcrypto/armcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: armcap.c,v 1.5 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: armcap.c,v 1.6 2014/06/20 21:00:46 deraadt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -44,13 +44,6 @@ OPENSSL_cpuid_setup(void) return; trigger = 1; -#ifndef __OpenBSD__ - if ((e = getenv("OPENSSL_armcap"))) { - OPENSSL_armcap_P = strtoul(e, NULL, 0); - return; - } -#endif - OPENSSL_armcap_P = 0; #if __ARM_ARCH__ >= 7 diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c index 2cb6e643ce0..bae59e28260 100644 --- a/lib/libcrypto/cryptlib.c +++ b/lib/libcrypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.26 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.27 2014/06/20 21:00:46 deraadt Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -653,20 +653,12 @@ OPENSSL_cpuid_setup(void) static int trigger = 0; IA32CAP OPENSSL_ia32_cpuid(void); IA32CAP vec; - char *env; if (trigger) return; - trigger = 1; - if ((env = getenv("OPENSSL_ia32cap"))) { - int off = (env[0] == '~') ? 1 : 0; - if (!sscanf(env+off, "%lli",(long long *)&vec)) - vec = strtoul(env + off, NULL, 0); - if (off) - vec = OPENSSL_ia32_cpuid() & ~vec; - } else - vec = OPENSSL_ia32_cpuid(); + + vec = OPENSSL_ia32_cpuid(); /* * |(1<<10) sets a reserved bit to signal that variable diff --git a/lib/libcrypto/sparcv9cap.c b/lib/libcrypto/sparcv9cap.c index 7b1b7ed0a6f..cc39c1bf453 100644 --- a/lib/libcrypto/sparcv9cap.c +++ b/lib/libcrypto/sparcv9cap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sparcv9cap.c,v 1.6 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: sparcv9cap.c,v 1.7 2014/06/20 21:00:46 deraadt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -53,11 +53,6 @@ OPENSSL_cpuid_setup(void) return; trigger = 1; - if ((e = getenv("OPENSSL_sparcv9cap"))) { - OPENSSL_sparcv9cap_P = strtoul(e, NULL, 0); - return; - } - /* Initial value, fits UltraSPARC-I&II... */ OPENSSL_sparcv9cap_P = SPARCV9_PREFER_FPU; |