mirror of
https://github.com/nextcloud/server.git
synced 2026-03-27 04:43:20 -04:00
Cleanup signature checking logic in encryption
Signed-off-by: jld3103 <jld3103yt@gmail.com>
This commit is contained in:
parent
0951398af8
commit
2f653c8be8
1 changed files with 6 additions and 4 deletions
|
|
@ -523,10 +523,12 @@ class Crypt {
|
|||
$signature = $this->createSignature($data, $passPhrase);
|
||||
$isCorrectHash = hash_equals($expectedSignature, $signature);
|
||||
|
||||
if (!$isCorrectHash && $enforceSignature) {
|
||||
throw new GenericEncryptionException('Bad Signature', $this->l->t('Bad Signature'));
|
||||
} elseif (!$isCorrectHash && !$enforceSignature) {
|
||||
$this->logger->info("Signature check skipped", ['app' => 'encryption']);
|
||||
if (!$isCorrectHash) {
|
||||
if ($enforceSignature) {
|
||||
throw new GenericEncryptionException('Bad Signature', $this->l->t('Bad Signature'));
|
||||
} else {
|
||||
$this->logger->info("Signature check skipped", ['app' => 'encryption']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue