BigInteger, RSA: updates to OpenSSL version detection code

This commit is contained in:
terrafrost 2013-09-20 12:14:01 -05:00
parent 71743ce243
commit 77447a3fc7
2 changed files with 9 additions and 7 deletions

View File

@ -491,15 +491,16 @@ class Crypt_RSA {
}
}
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
switch (true) {
case !isset($versions['Header']):
case !isset($versions['Library']):
case $versions['Header'] != $versions['Library']:
define('CRYPT_RSA_MODE', CRYPT_RSA_MODE_INTERNAL);
define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
case $versions['Header'] == $versions['Library']:
define('CRYPT_RSA_MODE', CRYPT_RSA_MODE_OPENSSL);
break;
default:
define('CRYPT_RSA_MODE', CRYPT_RSA_MODE_OPENSSL);
define('CRYPT_RSA_MODE', CRYPT_RSA_MODE_INTERNAL);
define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
}
break;
case true:

View File

@ -287,14 +287,15 @@ class Math_BigInteger {
}
}
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
switch (true) {
case !isset($versions['Header']):
case !isset($versions['Library']):
case $versions['Header'] != $versions['Library']:
define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
case $versions['Header'] == $versions['Library']:
define('MATH_BIGINTEGER_OPENSSL_ENABLED', true);
break;
default:
define('MATH_BIGINTEGER_OPENSSL_ENABLED', true);
define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
}
}