Commit cd7683db authored by Thomas Müller's avatar Thomas Müller Committed by Thomas Müller

Show apps with valid signature as approved

parent 11f7902b
......@@ -324,12 +324,13 @@ class Checker {
* @param string $signaturePath
* @param string $basePath
* @param string $certificateCN
* @param boolean $force
* @return array
* @throws InvalidSignatureException
* @throws \Exception
*/
private function verify($signaturePath, $basePath, $certificateCN) {
if(!$this->isCodeCheckEnforced()) {
private function verify($signaturePath, $basePath, $certificateCN, $force = false) {
if(!$force && !$this->isCodeCheckEnforced()) {
return [];
}
......@@ -509,9 +510,10 @@ class Checker {
*
* @param string $appId
* @param string $path Optional path. If none is given it will be guessed.
* @param boolean $force force check even if disabled
* @return array
*/
public function verifyAppSignature($appId, $path = '') {
public function verifyAppSignature($appId, $path = '', $force = false) {
try {
if($path === '') {
$path = $this->appLocator->getAppPath($appId);
......@@ -519,7 +521,8 @@ class Checker {
$result = $this->verify(
$path . '/appinfo/signature.json',
$path,
$appId
$appId,
$force
);
} catch (\Exception $e) {
$result = [
......
......@@ -64,6 +64,7 @@ class OC_App {
static private $loadedApps = [];
static private $altLogin = [];
const officialApp = 200;
const approvedApp = 100;
/**
* clean the appId
......@@ -864,6 +865,13 @@ class OC_App {
$info['level'] = self::officialApp;
$info['removable'] = false;
} else {
$result = \OC::$server->getIntegrityCodeChecker()->verifyAppSignature($app, '', true);
if (empty($result)) {
$info['internal'] = false;
$info['level'] = self::approvedApp;
$info['removable'] = false;
}
$info['internal'] = false;
$info['removable'] = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment