Fix encryption test

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-11-30 13:23:02 +01:00
parent 0e10d8cb7c
commit 98eede7f68
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 1 deletions

View File

@ -444,7 +444,8 @@ class Crypt {
*/
protected function isValidPrivateKey($plainKey) {
$res = openssl_get_privatekey($plainKey);
if (is_resource($res)) {
// TODO: remove resource check one php7.4 is not longer supported
if (is_resource($res) || (is_object($res) && get_class($res) === 'OpenSSLAsymmetricKey')) {
$sslInfo = openssl_pkey_get_details($res);
if (isset($sslInfo['key'])) {
return true;