mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 10:03:32 -04:00
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:
parent
7a61ffc3dd
commit
8796c6bc78
1 changed files with 3 additions and 1 deletions
|
|
@ -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'));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue