Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update Crawler.php
Signed-off-by: Andy Xheli <[email protected]>
  • Loading branch information
AndyXheli committed Apr 14, 2021
commit 3da5da42e0392869272d1a50462bdadf1aa92f98
6 changes: 5 additions & 1 deletion lib/Cron/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ 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);
openssl_free_key($certificate);

// PHP 8 automatically frees the key instance and deprecates the function
if (PHP_VERSION_ID < 80000) {
openssl_free_key($certificate);
}

if (!$verified) {
// Signature does not match
Expand Down