diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-22 13:13:41 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-22 13:13:41 +0100 |
commit | e3013a99ef5e9c44ef4f0661a2fb450f89df8d05 (patch) | |
tree | 47700b141506059d12599a0300f0c1ced5eac736 /lib | |
parent | 969581cc6850f3323066059bcdcda2dc21d8b019 (diff) | |
parent | ea367b598a98f8889383c917ceb7a6deb0c6ab7f (diff) | |
download | nextcloud-server-e3013a99ef5e9c44ef4f0661a2fb450f89df8d05.tar.gz nextcloud-server-e3013a99ef5e9c44ef4f0661a2fb450f89df8d05.zip |
Merge pull request #21816 from owncloud/require-a-specific-path-instead-of-autoguessing
Use path instead of app id for occ app signing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/integritycheck/checker.php | 11 |
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); |