diff --git a/CHANGELOG.md b/CHANGELOG.md index cc56b13..23ec628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.30b2 (2022-07-20) + +* prevent deprecation notice in PHP 8.0 and above + # 0.30b1 (2022-02-01) * specify columns on insert to be more robust regarding schema changes (thanks to @jonico) diff --git a/actions/read.php b/actions/read.php index 8bba031..73f8265 100644 --- a/actions/read.php +++ b/actions/read.php @@ -30,9 +30,12 @@ function read_secret($secret, &$error = null) { try { $decrypted_secret = decrypt_v01($secret, $recipients, $decrypt_error, $keyid, $fingerprint); } finally { - $keys = array_keys($recipients); - foreach ($keys as $key) { - openssl_pkey_free($recipients[$key]); + # prevent deprecation notice in PHP 8.0 and above + if (0 > version_compare(PHP_VERSION, "8.0.0")) { + $keys = array_keys($recipients); + foreach ($keys as $key) { + openssl_pkey_free($recipients[$key]); + } } zeroize_array($recipients); diff --git a/index.php b/index.php index 2cbf23f..ffe8d8b 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ version_compare(PHP_VERSION, "8.0.0")) { + openssl_pkey_free($privkey); + } } }