From 8796c6bc783f7d37088f26004c83d89fecabd7dc Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 27 Nov 2018 23:38:41 +0100 Subject: 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 --- apps/encryption/lib/Crypto/Crypt.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/encryption/lib/Crypto/Crypt.php') 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')); } -- cgit v1.2.3