Skip to content

Commit

Permalink
Merge pull request #338 from nextcloud/backport/332/stable24
Browse files Browse the repository at this point in the history
[stable24] fix: Correctly check result of function
  • Loading branch information
blizzz authored May 23, 2024
2 parents c56853b + 41d9fac commit 4f0ea26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cron/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function loadFeed() {

// Check if the signature actually matches the downloaded content
$certificate = openssl_get_publickey(file_get_contents(__DIR__ . '/../../appinfo/certificate.crt'));
$verified = (bool)openssl_verify($feedBody, base64_decode($signature), $certificate, OPENSSL_ALGO_SHA512);
$verified = openssl_verify($feedBody, base64_decode($signature), $certificate, OPENSSL_ALGO_SHA512) === 1;

// PHP 8 automatically frees the key instance and deprecates the function
if (PHP_VERSION_ID < 80000) {
Expand Down

0 comments on commit 4f0ea26

Please sign in to comment.