summaryrefslogtreecommitdiffstats
path: root/lib/private/integritycheck
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-13 10:35:00 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-13 10:35:00 +0100
commit37e8a87d46473614fca82cd0a6d85ac75d8a4640 (patch)
tree7356b2662415ecc2cf812a883cbf008b54060062 /lib/private/integritycheck
parente0aa6e01ab14191f42b2e79d32a9e0cc0203f975 (diff)
parentc009d5dcc1be69d280a71e01c5302f7fc3e5edc7 (diff)
downloadnextcloud-server-37e8a87d46473614fca82cd0a6d85ac75d8a4640.tar.gz
nextcloud-server-37e8a87d46473614fca82cd0a6d85ac75d8a4640.zip
Merge pull request #21591 from owncloud/add-code-checking-for-apps
Verify signature of apps with level "Official" coming from the appstore
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 770b64c6b9d..0cd01df7fe1 100644
--- a/lib/private/integritycheck/checker.php
+++ b/lib/private/integritycheck/checker.php
@@ -352,6 +352,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:
@@ -382,11 +390,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,
@@ -460,6 +471,7 @@ class Checker {
* and store the results.
*/
public function runInstanceVerification() {
+ $this->cleanResults();
$this->verifyCoreSignature();
$appIds = $this->appLocator->getAllApps();
foreach($appIds as $appId) {