Skip to content
This repository was archived by the owner on Mar 16, 2023. It is now read-only.

Commit 412102d

Browse files
committed
prevent deprecation notice in PHP 8.0 and above
1 parent 50b7e0e commit 412102d

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.30b2 (2022-07-20)
2+
3+
* prevent deprecation notice in PHP 8.0 and above
4+
15
# 0.30b1 (2022-02-01)
26

37
* specify columns on insert to be more robust regarding schema changes (thanks to @jonico)

actions/read.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ function read_secret($secret, &$error = null) {
3030
try {
3131
$decrypted_secret = decrypt_v01($secret, $recipients, $decrypt_error, $keyid, $fingerprint);
3232
} finally {
33-
$keys = array_keys($recipients);
34-
foreach ($keys as $key) {
35-
openssl_pkey_free($recipients[$key]);
33+
# prevent deprecation notice in PHP 8.0 and above
34+
if (0 > version_compare(PHP_VERSION, "8.0.0")) {
35+
$keys = array_keys($recipients);
36+
foreach ($keys as $key) {
37+
openssl_pkey_free($recipients[$key]);
38+
}
3639
}
3740

3841
zeroize_array($recipients);

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
# Shared-Secrets v0.30b1
3+
# Shared-Secrets v0.30b2
44
#
55
# Copyright (c) 2016-2022, SysEleven GmbH
66
# All rights reserved.

lib/shared-secrets.exec.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,10 @@ function open_pubkey($string) {
555555
}
556556
}
557557
} finally {
558-
openssl_pkey_free($privkey);
558+
# prevent deprecation notice in PHP 8.0 and above
559+
if (0 > version_compare(PHP_VERSION, "8.0.0")) {
560+
openssl_pkey_free($privkey);
561+
}
559562
}
560563
}
561564

0 commit comments

Comments
 (0)