Skip to content

Commit

Permalink
in case 'encryption_skip_signature_check' was set to true we accept i…
Browse files Browse the repository at this point in the history
…f the file doesn't has a signature

Signed-off-by: Bjoern Schiessle <[email protected]>
  • Loading branch information
schiessle committed Nov 27, 2018
1 parent 7a61ffc commit 8796c6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/encryption/lib/Crypto/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,13 @@ private function splitMetaData($catFile, $cipher) {
* @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'));
}

Expand Down

0 comments on commit 8796c6b

Please sign in to comment.