Skip to content

Commit

Permalink
Fix encryption test
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Nov 30, 2020
1 parent da5f107 commit dbe36da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/encryption/lib/Crypto/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ public function decryptPrivateKey($privateKey, $password = '', $uid = '') {
*/
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) || get_class($res) === 'OpenSSLAsymmetricKey') {
$sslInfo = openssl_pkey_get_details($res);
if (isset($sslInfo['key'])) {
return true;
Expand Down

0 comments on commit dbe36da

Please sign in to comment.