Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-15 18:29:54 +0300
committerJoas Schilling <coding@schilljs.com>2021-01-18 13:32:50 +0300
commitf319660f60c9e7d863cec65c983ca24800a6d3ed (patch)
treef364ba220b11dd75432d68098bcc00c804a42ab6 /lib
parent6d291c3c1934e97914a9c22e66355769efe3f6d0 (diff)
Force run the verification of the signature on occ
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/IntegrityCheck/Checker.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php
index 504cd391c42..353a76f8f1a 100644
--- a/lib/private/IntegrityCheck/Checker.php
+++ b/lib/private/IntegrityCheck/Checker.php
@@ -311,12 +311,13 @@ class Checker {
* @param string $signaturePath
* @param string $basePath
* @param string $certificateCN
+ * @param bool $forceVerify
* @return array
* @throws InvalidSignatureException
* @throws \Exception
*/
- private function verify(string $signaturePath, string $basePath, string $certificateCN): array {
- if (!$this->isCodeCheckEnforced()) {
+ private function verify(string $signaturePath, string $basePath, string $certificateCN, bool $forceVerify = false): array {
+ if (!$forceVerify && !$this->isCodeCheckEnforced()) {
return [];
}
@@ -495,9 +496,10 @@ class Checker {
*
* @param string $appId
* @param string $path Optional path. If none is given it will be guessed.
+ * @param bool $forceVerify
* @return array
*/
- public function verifyAppSignature(string $appId, string $path = ''): array {
+ public function verifyAppSignature(string $appId, string $path = '', bool $forceVerify = false): array {
try {
if ($path === '') {
$path = $this->appLocator->getAppPath($appId);
@@ -505,7 +507,8 @@ class Checker {
$result = $this->verify(
$path . '/appinfo/signature.json',
$path,
- $appId
+ $appId,
+ $forceVerify
);
} catch (\Exception $e) {
$result = [