summaryrefslogtreecommitdiffstats
path: root/core/Command/Integrity
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-12-21 13:03:13 +0100
committerGitHub <noreply@github.com>2016-12-21 13:03:13 +0100
commit091bf07385a6e850383ee8364e282a5bbac6adc2 (patch)
treeb131cd3760bc11f1a41de6844c624c9033705b3d /core/Command/Integrity
parent0d138c85915d3ae80de27d73da4ff1fafb1dd1cd (diff)
parent3eb3e437c8a0520192ec7c1018d4d1c55e780dc0 (diff)
downloadnextcloud-server-091bf07385a6e850383ee8364e282a5bbac6adc2.tar.gz
nextcloud-server-091bf07385a6e850383ee8364e282a5bbac6adc2.zip
Merge pull request #2724 from nextcloud/fix-23591
[downstream] Report failures for SignApp and SignCore
Diffstat (limited to 'core/Command/Integrity')
-rw-r--r--core/Command/Integrity/SignApp.php11
-rw-r--r--core/Command/Integrity/SignCore.php12
2 files changed, 16 insertions, 7 deletions
diff --git a/core/Command/Integrity/SignApp.php b/core/Command/Integrity/SignApp.php
index 3bc79eb0114..26d2791475b 100644
--- a/core/Command/Integrity/SignApp.php
+++ b/core/Command/Integrity/SignApp.php
@@ -101,8 +101,13 @@ class SignApp extends Command {
$x509 = new X509();
$x509->loadX509($keyBundle);
$x509->setPrivateKey($rsa);
- $this->checker->writeAppSignature($path, $x509, $rsa);
-
- $output->writeln('Successfully signed "'.$path.'"');
+ try {
+ $this->checker->writeAppSignature($path, $x509, $rsa);
+ $output->writeln('Successfully signed "'.$path.'"');
+ } catch (\Exception $e){
+ $output->writeln('Error: ' . $e->getMessage());
+ return 1;
+ }
+ return 0;
}
}
diff --git a/core/Command/Integrity/SignCore.php b/core/Command/Integrity/SignCore.php
index 440c3da3b23..8f951204a58 100644
--- a/core/Command/Integrity/SignCore.php
+++ b/core/Command/Integrity/SignCore.php
@@ -23,12 +23,10 @@
namespace OC\Core\Command\Integrity;
use OC\IntegrityCheck\Checker;
-use OC\IntegrityCheck\Helpers\EnvironmentHelper;
use OC\IntegrityCheck\Helpers\FileAccessHelper;
use phpseclib\Crypt\RSA;
use phpseclib\File\X509;
use Symfony\Component\Console\Command\Command;
-use OCP\IConfig;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -94,8 +92,14 @@ class SignCore extends Command {
$x509 = new X509();
$x509->loadX509($keyBundle);
$x509->setPrivateKey($rsa);
- $this->checker->writeCoreSignature($x509, $rsa, $path);
- $output->writeln('Successfully signed "core"');
+ try {
+ $this->checker->writeCoreSignature($x509, $rsa, $path);
+ $output->writeln('Successfully signed "core"');
+ } catch (\Exception $e){
+ $output->writeln('Error: ' . $e->getMessage());
+ return 1;
+ }
+ return 0;
}
}