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>
This commit is contained in:
Bjoern Schiessle 2018-11-27 23:38:41 +01:00
parent 7a61ffc3dd
commit 8796c6bc78
No known key found for this signature in database
GPG key ID: 2378A753E2BF04F6

View file

@ -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'));
}