Skip to content
Snippets Groups Projects
Unverified Commit f319660f authored by Joas Schilling's avatar Joas Schilling
Browse files

Force run the verification of the signature on occ

parent 6d291c3c
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ class CheckApp extends Base {
protected function execute(InputInterface $input, OutputInterface $output): int {
$appid = $input->getArgument('appid');
$path = (string)$input->getOption('path');
$result = $this->checker->verifyAppSignature($appid, $path);
$result = $this->checker->verifyAppSignature($appid, $path, true);
$this->writeArrayInOutputFormat($input, $output, $result);
if (count($result) > 0) {
return 1;
......
......@@ -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 = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment