diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-11-30 15:24:05 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-11-30 15:24:05 +0100 |
commit | 34d4c2bc169258c414d0dd3a527335b58167a184 (patch) | |
tree | a36bfcf273dac032563787e3acc3530ec10cf664 /apps/encryption | |
parent | 8796c6bc783f7d37088f26004c83d89fecabd7dc (diff) | |
download | nextcloud-server-34d4c2bc169258c414d0dd3a527335b58167a184.tar.gz nextcloud-server-34d4c2bc169258c414d0dd3a527335b58167a184.zip |
improve variable naming
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/encryption')
-rw-r--r-- | apps/encryption/lib/Crypto/Crypt.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index a00b93927fa..b2fdec513d2 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -482,14 +482,14 @@ class Crypt { * @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']); } } |