From: Andy Polyakov Date: Fri, 9 Dec 2011 15:46:41 +0000 (+0000) Subject: cryptlib.c: allow for OPENSSL_ia32cap=~0x????? syntax for environment value X-Git-Tag: OpenSSL_1_0_1-beta1~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b140ae91375582f3840d4daa13edb1a94951e0b7;p=oweals%2Fopenssl.git cryptlib.c: allow for OPENSSL_ia32cap=~0x????? syntax for environment value in question. --- diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 8384b5d339..615bcebec4 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -693,12 +693,15 @@ void OPENSSL_cpuid_setup(void) if (trigger) return; trigger=1; - if ((env=getenv("OPENSSL_ia32cap"))) + if ((env=getenv("OPENSSL_ia32cap"))) { + int off = (env[0]=='~')?1:0; #if defined(_WIN32) - { if (!sscanf(env,"%I64i",&vec)) vec = strtoul(env,NULL,0); } + if (!sscanf(env+off,"%I64i",&vec)) vec = strtoul(env+off,NULL,0); #else - vec = strtoull(env,NULL,0); + vec = strtoull(env+off,NULL,0); #endif + if (off) vec = OPENSSL_ia32_cpuid()&~vec; + } else vec = OPENSSL_ia32_cpuid(); /*