Skip to content
Snippets Groups Projects
Unverified Commit 98eede7f authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Fix encryption test

parent 0e10d8cb
No related branches found
No related tags found
No related merge requests found
...@@ -444,7 +444,8 @@ class Crypt { ...@@ -444,7 +444,8 @@ class Crypt {
*/ */
protected function isValidPrivateKey($plainKey) { protected function isValidPrivateKey($plainKey) {
$res = openssl_get_privatekey($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); $sslInfo = openssl_pkey_get_details($res);
if (isset($sslInfo['key'])) { if (isset($sslInfo['key'])) {
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment