summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-11-30 13:23:02 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-12-07 15:44:04 +0100
commit98eede7f68f8720842f81aa1133816da1ce9aab9 (patch)
treeac4050fd4430b4698788a76c6d62117902cd6e2a /apps/encryption/lib
parent0e10d8cb7cf68ea97739b1f1f2426b52b6549d60 (diff)
downloadnextcloud-server-98eede7f68f8720842f81aa1133816da1ce9aab9.tar.gz
nextcloud-server-98eede7f68f8720842f81aa1133816da1ce9aab9.zip
Fix encryption test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/Crypto/Crypt.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 57aecf95633..94979bde866 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -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;