From 6a6c22234a5b1502b1c0bb90917d31478a2b7f3e Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 24 Jan 2024 07:42:28 -0600 Subject: [PATCH] EC: when using openssl to do signing use unencrypted key --- phpseclib/Crypt/EC/PrivateKey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Crypt/EC/PrivateKey.php b/phpseclib/Crypt/EC/PrivateKey.php index 462ea1a3..59886961 100644 --- a/phpseclib/Crypt/EC/PrivateKey.php +++ b/phpseclib/Crypt/EC/PrivateKey.php @@ -150,7 +150,7 @@ final class PrivateKey extends EC implements Common\PrivateKey // we use specified curves to avoid issues with OpenSSL possibly not supporting a given named curve; // doing this may mean some curve-specific optimizations can't be used but idk if OpenSSL even // has curve-specific optimizations - $result = openssl_sign($message, $signature, $this->toString('PKCS8', ['namedCurve' => false]), $this->hash->getHash()); + $result = openssl_sign($message, $signature, $this->withPassword()->toString('PKCS8', ['namedCurve' => false]), $this->hash->getHash()); if ($result) { if ($shortFormat == 'ASN1') {