summaryrefslogtreecommitdiffstats
path: root/lib/private/integritycheck
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-01-09 22:15:50 +0100
committerLukas Reschke <lukas@owncloud.com>2016-01-10 19:40:28 +0100
commitc009d5dcc1be69d280a71e01c5302f7fc3e5edc7 (patch)
tree41cf627cb0c3a11b2450e3f0737bd360060b2a8f /lib/private/integritycheck
parent656b5418996744b5ba095afac59b4fdb4db37337 (diff)
downloadnextcloud-server-c009d5dcc1be69d280a71e01c5302f7fc3e5edc7.tar.gz
nextcloud-server-c009d5dcc1be69d280a71e01c5302f7fc3e5edc7.zip
Verify signature of apps with level "Official" coming from the appstore
This change will verify the signature of all apps with the level "Official" coming from the appstore or if they have been signed before.
Diffstat (limited to 'lib/private/integritycheck')
-rw-r--r--lib/private/integritycheck/checker.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/integritycheck/checker.php b/lib/private/integritycheck/checker.php
index edfe6b082e7..baffa9f735b 100644
--- a/lib/private/integritycheck/checker.php
+++ b/lib/private/integritycheck/checker.php
@@ -320,6 +320,14 @@ class Checker {
$this->cache->set(self::CACHE_KEY, json_encode($resultArray));
}
+ /**
+ *
+ * Clean previous results for a proper rescanning. Otherwise
+ */
+ private function cleanResults() {
+ $this->config->deleteAppValue('core', self::CACHE_KEY);
+ $this->cache->remove(self::CACHE_KEY);
+ }
/**
* Verify the signature of $appId. Returns an array with the following content:
@@ -350,11 +358,14 @@ class Checker {
* Array may be empty in case no problems have been found.
*
* @param string $appId
+ * @param string $path Optional path. If none is given it will be guessed.
* @return array
*/
- public function verifyAppSignature($appId) {
+ public function verifyAppSignature($appId, $path = '') {
try {
- $path = $this->appLocator->getAppPath($appId);
+ if($path === '') {
+ $path = $this->appLocator->getAppPath($appId);
+ }
$result = $this->verify(
$path . '/appinfo/signature.json',
$path,
@@ -428,6 +439,7 @@ class Checker {
* and store the results.
*/
public function runInstanceVerification() {
+ $this->cleanResults();
$this->verifyCoreSignature();
$appIds = $this->appLocator->getAllApps();
foreach($appIds as $appId) {