Skip to content

Commit bbb3fee

Browse files
Merge pull request #557 from nextcloud/backport/556/stable29
[stable29] fix: Correctly check result of function
2 parents 072003a + c76fcaf commit bbb3fee

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,12 +708,12 @@ public function verifyIntegrity(): void {
708708
-----END CERTIFICATE-----
709709
EOF;
710710

711-
$validSignature = (bool)openssl_verify(
711+
$validSignature = openssl_verify(
712712
file_get_contents($this->getDownloadedFilePath()),
713713
base64_decode($response['signature']),
714714
$certificate,
715715
OPENSSL_ALGO_SHA512
716-
);
716+
) === 1;
717717

718718
if ($validSignature === false) {
719719
throw new \Exception('Signature of update is not valid');

lib/Updater.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,12 @@ public function verifyIntegrity(): void {
670670
-----END CERTIFICATE-----
671671
EOF;
672672

673-
$validSignature = (bool)openssl_verify(
673+
$validSignature = openssl_verify(
674674
file_get_contents($this->getDownloadedFilePath()),
675675
base64_decode($response['signature']),
676676
$certificate,
677677
OPENSSL_ALGO_SHA512
678-
);
678+
) === 1;
679679

680680
if ($validSignature === false) {
681681
throw new \Exception('Signature of update is not valid');

updater.phar

2 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)