diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-11-27 23:38:41 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-11-27 23:38:41 +0100 |
commit | 8796c6bc783f7d37088f26004c83d89fecabd7dc (patch) | |
tree | 3f97a5caf6d69ad65920a363233f08f994abb564 /apps/encryption/lib/Crypto/Crypt.php | |
parent | 7a61ffc3ddb2fa377074335f13080468eb29b3dc (diff) | |
download | nextcloud-server-8796c6bc783f7d37088f26004c83d89fecabd7dc.tar.gz nextcloud-server-8796c6bc783f7d37088f26004c83d89fecabd7dc.zip |
in case 'encryption_skip_signature_check' was set to true we accept if the file doesn't has a signature
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/encryption/lib/Crypto/Crypt.php')
-rw-r--r-- | apps/encryption/lib/Crypto/Crypt.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index a22d4551566..a00b93927fa 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -563,11 +563,13 @@ class Crypt { * @throws GenericEncryptionException */ private function hasSignature($catFile, $cipher) { + $skipSignatureCheck = $this->config->getSystemValue('encryption_skip_signature_check', false); + $meta = substr($catFile, -93); $signaturePosition = strpos($meta, '00sig00'); // enforce signature for the new 'CTR' ciphers - if ($signaturePosition === false && stripos($cipher, 'ctr') !== false) { + if (!$skipSignatureCheck && $signaturePosition === false && stripos($cipher, 'ctr') !== false) { throw new GenericEncryptionException('Missing Signature', $this->l->t('Missing Signature')); } |