diff options
author | Anna <anna@nextcloud.com> | 2024-05-15 16:07:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 16:07:23 +0200 |
commit | b24ac6bc714e970cb8dd2f1723a030c2b913368b (patch) | |
tree | 6ffe32654ed1f2903ec1a8429f7d216569e36316 /lib | |
parent | bc013ef5e77974dcad8d21279a347e6bd782d98e (diff) | |
parent | b627e6efe497bcaad6f6696a6141e6ad0b79a1c6 (diff) | |
download | nextcloud-server-b24ac6bc714e970cb8dd2f1723a030c2b913368b.tar.gz nextcloud-server-b24ac6bc714e970cb8dd2f1723a030c2b913368b.zip |
Merge pull request #45321 from nextcloud/bugfix/noid/check-function-call
fix: Correctly check result of function
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Installer.php | 2 | ||||
-rw-r--r-- | lib/private/Security/IdentityProof/Signer.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index c4df7768d9e..0f9aa404263 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -280,7 +280,7 @@ class Installer { // Check if the signature actually matches the downloaded content $certificate = openssl_get_publickey($app['certificate']); - $verified = (bool)openssl_verify(file_get_contents($tempFile), base64_decode($app['releases'][0]['signature']), $certificate, OPENSSL_ALGO_SHA512); + $verified = openssl_verify(file_get_contents($tempFile), base64_decode($app['releases'][0]['signature']), $certificate, OPENSSL_ALGO_SHA512) === 1; if ($verified === true) { // Seems to match, let's proceed diff --git a/lib/private/Security/IdentityProof/Signer.php b/lib/private/Security/IdentityProof/Signer.php index 1458390c327..63c5d049b74 100644 --- a/lib/private/Security/IdentityProof/Signer.php +++ b/lib/private/Security/IdentityProof/Signer.php @@ -74,12 +74,12 @@ class Signer { $user = $this->userManager->get($userId); if ($user !== null) { $key = $this->keyManager->getKey($user); - return (bool)openssl_verify( + return openssl_verify( json_encode($data['message']), base64_decode($data['signature']), $key->getPublic(), OPENSSL_ALGO_SHA512 - ); + ) === 1; } } |