RSA: conditionally call useBestEngine() when getEngine() is called

This commit is contained in:
terrafrost 2022-03-20 11:30:24 -05:00
parent eb971aaaac
commit 301aad4764

View File

@ -935,6 +935,9 @@ abstract class RSA extends AsymmetricKey
*/
public function getEngine()
{
if (!isset(self::$engines['PHP'])) {
self::useBestEngine();
}
return self::$engines['OpenSSL'] && self::$defaultExponent == 65537 ?
'OpenSSL' :
'PHP';