From 301aad47644f0ac8b622fc627e8a00d2b8a4be19 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 20 Mar 2022 11:30:24 -0500 Subject: [PATCH] RSA: conditionally call useBestEngine() when getEngine() is called --- phpseclib/Crypt/RSA.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index c102efde..b3cb0ba6 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -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';