Skip to content

Commit b9973cd

Browse files
authored
Fix: openssl_pkey_free is deprecated for PHP 8 (#321)
1 parent 201d55d commit b9973cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Encryption.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ private static function createLocalKeyObjectUsingOpenSSL(): array
313313
}
314314

315315
$details = openssl_pkey_get_details($keyResource);
316-
openssl_pkey_free($keyResource);
316+
if (PHP_MAJOR_VERSION < 8) {
317+
openssl_pkey_free($keyResource);
318+
}
317319

318320
if (!$details) {
319321
throw new \RuntimeException('Unable to get the key details');

0 commit comments

Comments
 (0)