diff options
author | deraadt <> | 2014-06-20 21:00:46 +0000 |
---|---|---|
committer | deraadt <> | 2014-06-20 21:00:46 +0000 |
commit | fd246cd3bca6f8a162fc23c4fb7d3a825de618b8 (patch) | |
tree | 41b3deca5d67323bed9044e403bbe1c6418748bf /src/lib/libcrypto/cryptlib.c | |
parent | 7ad0caae1a0b3317154a69d8faea6b9be64f37f5 (diff) | |
download | openbsd-fd246cd3bca6f8a162fc23c4fb7d3a825de618b8.tar.gz openbsd-fd246cd3bca6f8a162fc23c4fb7d3a825de618b8.tar.bz2 openbsd-fd246cd3bca6f8a162fc23c4fb7d3a825de618b8.zip |
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
Diffstat (limited to 'src/lib/libcrypto/cryptlib.c')
-rw-r--r-- | src/lib/libcrypto/cryptlib.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index 2cb6e643ce..bae59e2826 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cryptlib.c,v 1.26 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: cryptlib.c,v 1.27 2014/06/20 21:00:46 deraadt 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 | * |
@@ -653,20 +653,12 @@ OPENSSL_cpuid_setup(void) | |||
653 | static int trigger = 0; | 653 | static int trigger = 0; |
654 | IA32CAP OPENSSL_ia32_cpuid(void); | 654 | IA32CAP OPENSSL_ia32_cpuid(void); |
655 | IA32CAP vec; | 655 | IA32CAP vec; |
656 | char *env; | ||
657 | 656 | ||
658 | if (trigger) | 657 | if (trigger) |
659 | return; | 658 | return; |
660 | |||
661 | trigger = 1; | 659 | trigger = 1; |
662 | if ((env = getenv("OPENSSL_ia32cap"))) { | 660 | |
663 | int off = (env[0] == '~') ? 1 : 0; | 661 | vec = OPENSSL_ia32_cpuid(); |
664 | if (!sscanf(env+off, "%lli",(long long *)&vec)) | ||
665 | vec = strtoul(env + off, NULL, 0); | ||
666 | if (off) | ||
667 | vec = OPENSSL_ia32_cpuid() & ~vec; | ||
668 | } else | ||
669 | vec = OPENSSL_ia32_cpuid(); | ||
670 | 662 | ||
671 | /* | 663 | /* |
672 | * |(1<<10) sets a reserved bit to signal that variable | 664 | * |(1<<10) sets a reserved bit to signal that variable |