mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
BigInteger, RSA: updates to OpenSSL version detection code
This commit is contained in:
parent
71743ce243
commit
77447a3fc7
@ -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:
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user