Skip to content

Commit

Permalink
fix signing tests on php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
smoench committed Dec 18, 2020
1 parent 930484f commit 878b357
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use function KevinGH\Box\FileSystem\remove;
use KevinGH\Box\PhpScoper\NullScoper;
use KevinGH\Box\PhpScoper\WhitelistManipulator;
use function openssl_error_string;
use function openssl_pkey_export;
use function openssl_pkey_get_details;
use function openssl_pkey_get_private;
Expand Down Expand Up @@ -362,7 +363,7 @@ public function sign(string $key, ?string $password): void

$resource = openssl_pkey_get_private($key, (string) $password);

Assertion::isResource($resource, 'Could not retrieve the private key, check that the password is correct.');
Assertion::notSame(false, $resource, sprintf('Could not retrieve the private key, check that the password is correct. "%s"', openssl_error_string() ?: ''));

openssl_pkey_export($resource, $private);

Expand Down

0 comments on commit 878b357

Please sign in to comment.