diff options
| author | deraadt <> | 2014-06-20 21:00:46 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-06-20 21:00:46 +0000 |
| commit | 54a16e60e2d46d32bde1eb6e8f8f17d15936e507 (patch) | |
| tree | 41b3deca5d67323bed9044e403bbe1c6418748bf /src/lib/libcrypto/cryptlib.c | |
| parent | 54450110ee6231bce58f01d0829bc19c2c8f9592 (diff) | |
| download | openbsd-54a16e60e2d46d32bde1eb6e8f8f17d15936e507.tar.gz openbsd-54a16e60e2d46d32bde1eb6e8f8f17d15936e507.tar.bz2 openbsd-54a16e60e2d46d32bde1eb6e8f8f17d15936e507.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 |
