Skip to content

Commit

Permalink
Merge pull request #333 from nextcloud/backport/332/stable29
Browse files Browse the repository at this point in the history
[stable29] fix: Correctly check result of function
  • Loading branch information
miaulalala authored May 15, 2024
2 parents e38f1bc + 234e9f8 commit a33e964
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 @@ -178,7 +178,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 a33e964

Please sign in to comment.