summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-01-15 14:14:32 +0100
committerLukas Reschke <lukas@owncloud.com>2016-01-20 20:38:18 +0100
commitea367b598a98f8889383c917ceb7a6deb0c6ab7f (patch)
tree251f6f3f274081b51496379a6d5816f90bd011f5 /lib/private
parent647d8ea5decad8140f9c280ae90039aa71c4eb93 (diff)
downloadnextcloud-server-ea367b598a98f8889383c917ceb7a6deb0c6ab7f.tar.gz
nextcloud-server-ea367b598a98f8889383c917ceb7a6deb0c6ab7f.zip
Use path instead of app id
This change requires the usage of a path instead of the App ID when signing code. This has the advantage that developers can also sign code under a different location to make it easier. (e.g. remove `.git`, …) Also it adds an example command usage as well as a link to the documentation
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/integritycheck/checker.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/integritycheck/checker.php b/lib/private/integritycheck/checker.php
index 0cd01df7fe1..926a7725ff3 100644
--- a/lib/private/integritycheck/checker.php
+++ b/lib/private/integritycheck/checker.php
@@ -114,6 +114,7 @@ class Checker {
*
* @param string $folderToIterate
* @return \RecursiveIteratorIterator
+ * @throws \Exception
*/
private function getFolderIterator($folderToIterate) {
$dirItr = new \RecursiveDirectoryIterator(
@@ -189,17 +190,19 @@ class Checker {
}
/**
- * Write the signature of the specified app
+ * Write the signature of the app in the specified folder
*
- * @param string $appId
+ * @param string $path
* @param X509 $certificate
* @param RSA $privateKey
* @throws \Exception
*/
- public function writeAppSignature($appId,
+ public function writeAppSignature($path,
X509 $certificate,
RSA $privateKey) {
- $path = $this->appLocator->getAppPath($appId);
+ if(!is_dir($path)) {
+ throw new \Exception('Directory does not exist.');
+ }
$iterator = $this->getFolderIterator($path);
$hashes = $this->generateHashes($iterator, $path);
$signature = $this->createSignatureData($hashes, $certificate, $privateKey);