Skip to content

Commit

Permalink
improve variable naming
Browse files Browse the repository at this point in the history
Signed-off-by: Bjoern Schiessle <[email protected]>
  • Loading branch information
schiessle committed Nov 30, 2018
1 parent 8796c6b commit 34d4c2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/encryption/lib/Crypto/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,14 @@ public function symmetricDecryptFileContent($keyFileContents, $passPhrase, $ciph
* @throws GenericEncryptionException
*/
private function checkSignature($data, $passPhrase, $expectedSignature) {
$skipSignatureCheck = $this->config->getSystemValue('encryption_skip_signature_check', false);
$enforceSignature = !$this->config->getSystemValue('encryption_skip_signature_check', false);

$signature = $this->createSignature($data, $passPhrase);
$hash = hash_equals($expectedSignature, $signature);
$isCorrectHash = hash_equals($expectedSignature, $signature);

if (!$hash && $skipSignatureCheck === false) {
if (!$isCorrectHash && $enforceSignature) {
throw new GenericEncryptionException('Bad Signature', $this->l->t('Bad Signature'));
} else if (!$hash && $skipSignatureCheck) {
} else if (!$isCorrectHash && !$enforceSignature) {
$this->logger->info("Signature check skipped", ['app' => 'encryption']);
}
}
Expand Down

0 comments on commit 34d4c2b

Please sign in to comment.