Skip to content

Commit 878b357

Browse files
author
smoench
committed
fix signing tests on php 8
1 parent 930484f commit 878b357

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Box.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
use function KevinGH\Box\FileSystem\remove;
4242
use KevinGH\Box\PhpScoper\NullScoper;
4343
use KevinGH\Box\PhpScoper\WhitelistManipulator;
44+
use function openssl_error_string;
4445
use function openssl_pkey_export;
4546
use function openssl_pkey_get_details;
4647
use function openssl_pkey_get_private;
@@ -362,7 +363,7 @@ public function sign(string $key, ?string $password): void
362363

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

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

367368
openssl_pkey_export($resource, $private);
368369

0 commit comments

Comments
 (0)