diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 5d1d2405..50642eb7 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -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: diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index fea3f630..e40433de 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -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); } }