Browse Source
Allow to disable the signature check
This allows you to recover encryption files even if the signature is broken
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
pull/12678/head
Bjoern Schiessle
7 years ago
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
1 changed files with
7 additions and
1 deletions
-
apps/encryption/lib/Crypto/Crypt.php
|
|
|
@ -482,9 +482,15 @@ class Crypt { |
|
|
|
* @throws GenericEncryptionException |
|
|
|
*/ |
|
|
|
private function checkSignature($data, $passPhrase, $expectedSignature) { |
|
|
|
$skipSignatureCheck = $this->config->getSystemValue('encryption_skip_signature_check', false); |
|
|
|
|
|
|
|
$signature = $this->createSignature($data, $passPhrase); |
|
|
|
if (!hash_equals($expectedSignature, $signature)) { |
|
|
|
$hash = hash_equals($expectedSignature, $signature); |
|
|
|
|
|
|
|
if (!$hash && $skipSignatureCheck === false) { |
|
|
|
throw new GenericEncryptionException('Bad Signature', $this->l->t('Bad Signature')); |
|
|
|
} else if (!$hash && $skipSignatureCheck) { |
|
|
|
$this->logger->info("Signature check skipped", ['app' => 'encryption']); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|