Skip to content

Commit

Permalink
Merge pull request #556 from nextcloud/bugfix/noid/check-function-call
Browse files Browse the repository at this point in the history
fix: Correctly check result of function
  • Loading branch information
blizzz authored May 15, 2024
2 parents c724e53 + e21395e commit 703f99d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,12 @@ public function verifyIntegrity(): void {
-----END CERTIFICATE-----
EOF;

$validSignature = (bool)openssl_verify(
$validSignature = openssl_verify(
file_get_contents($this->getDownloadedFilePath()),
base64_decode($response['signature']),
$certificate,
OPENSSL_ALGO_SHA512
);
) === 1;

if ($validSignature === false) {
throw new \Exception('Signature of update is not valid');
Expand Down
4 changes: 2 additions & 2 deletions lib/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,12 @@ public function verifyIntegrity(): void {
-----END CERTIFICATE-----
EOF;

$validSignature = (bool)openssl_verify(
$validSignature = openssl_verify(
file_get_contents($this->getDownloadedFilePath()),
base64_decode($response['signature']),
$certificate,
OPENSSL_ALGO_SHA512
);
) === 1;

if ($validSignature === false) {
throw new \Exception('Signature of update is not valid');
Expand Down
Binary file modified updater.phar
Binary file not shown.

0 comments on commit 703f99d

Please sign in to comment.