Skip to content

Commit

Permalink
EC: when using openssl to do signing use unencrypted key
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Jan 24, 2024
1 parent 6b34da4 commit 6a6c222
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phpseclib/Crypt/EC/PrivateKey.php
Expand Up @@ -150,7 +150,7 @@ public function sign($message)
// 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') {
Expand Down

1 comment on commit 6a6c222

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1979

Please sign in to comment.