mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-11 00:29:36 +01:00
EC / DSA: useBestEngine() needs to be called in getEngine()
This commit is contained in:
parent
301aad4764
commit
9a1e1caa90
@ -292,6 +292,9 @@ abstract class DSA extends AsymmetricKey
|
|||||||
*/
|
*/
|
||||||
public function getEngine()
|
public function getEngine()
|
||||||
{
|
{
|
||||||
|
if (!isset(self::$engines['PHP'])) {
|
||||||
|
self::useBestEngine();
|
||||||
|
}
|
||||||
return self::$engines['OpenSSL'] && in_array($this->hash->getHash(), openssl_get_md_methods()) ?
|
return self::$engines['OpenSSL'] && in_array($this->hash->getHash(), openssl_get_md_methods()) ?
|
||||||
'OpenSSL' : 'PHP';
|
'OpenSSL' : 'PHP';
|
||||||
}
|
}
|
||||||
|
@ -323,6 +323,9 @@ abstract class EC extends AsymmetricKey
|
|||||||
*/
|
*/
|
||||||
public function getEngine()
|
public function getEngine()
|
||||||
{
|
{
|
||||||
|
if (!isset(self::$engines['PHP'])) {
|
||||||
|
self::useBestEngine();
|
||||||
|
}
|
||||||
if ($this->curve instanceof TwistedEdwardsCurve) {
|
if ($this->curve instanceof TwistedEdwardsCurve) {
|
||||||
return $this->curve instanceof Ed25519 && self::$engines['libsodium'] && !isset($this->context) ?
|
return $this->curve instanceof Ed25519 && self::$engines['libsodium'] && !isset($this->context) ?
|
||||||
'libsodium' : 'PHP';
|
'libsodium' : 'PHP';
|
||||||
|
Loading…
Reference in New Issue
Block a user