summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/crypto/crypt.php
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-01-05 15:29:44 +0100
committerLukas Reschke <lukas@owncloud.com>2016-02-09 23:43:25 +0100
commitcf3a8f274f05170b69cb3872d0d8c9045a5876d3 (patch)
tree6edd8a9f8327d530320a6ec9a1fb9f1a74a39f48 /apps/encryption/lib/crypto/crypt.php
parent40a5ba72fc868207356c9143c99a947f1a6e6500 (diff)
downloadnextcloud-server-cf3a8f274f05170b69cb3872d0d8c9045a5876d3.tar.gz
nextcloud-server-cf3a8f274f05170b69cb3872d0d8c9045a5876d3.zip
make it backward compatible to work with signed and un-signed files
Diffstat (limited to 'apps/encryption/lib/crypto/crypt.php')
-rw-r--r--apps/encryption/lib/crypto/crypt.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php
index f4c47d33f00..e935f364551 100644
--- a/apps/encryption/lib/crypto/crypt.php
+++ b/apps/encryption/lib/crypto/crypt.php
@@ -462,7 +462,7 @@ class Crypt {
*/
private function checkSignature($data, $passPhrase, $expectedSignature) {
$signature = $this->createSignature($data, $passPhrase);
- if (hash_equals($expectedSignature, $signature)) {
+ if (!hash_equals($expectedSignature, $signature)) {
throw new HintException('Bad Signature', $this->l->t('Bad Signature'));
}
}
@@ -517,7 +517,7 @@ class Crypt {
$meta = substr($catFile, -22);
$iv = substr($meta, -16);
$sig = false;
- $encrypted = substr($catFile, 0, -93);
+ $encrypted = substr($catFile, 0, -22);
}
return [