bug #34285 [FrameworkBundle] fix SodiumVault after stof review (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix SodiumVault after stof review

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

As spotted by @stof in https://github.com/symfony/symfony/pull/34275#pullrequestreview-313355834

Commits
-------

a594599078 [FrameworkBundle] fix SodiumVault after stof review
This commit is contained in:
Nicolas Grekas 2019-11-08 09:34:16 +01:00
commit 7a8b85cc67

View File

@ -52,7 +52,7 @@ class SodiumVault extends AbstractVault
try {
$this->loadKeys();
} catch (\LogicException $e) {
} catch (\RuntimeException $e) {
// ignore failures to load keys
}
@ -186,7 +186,7 @@ class SodiumVault extends AbstractVault
} elseif ('' !== $this->decryptionKey) {
$this->encryptionKey = sodium_crypto_box_publickey($this->decryptionKey);
} else {
throw new \LogicException(sprintf('Encryption key not found in "%s".', \dirname($this->pathPrefix)));
throw new \RuntimeException(sprintf('Encryption key not found in "%s".', \dirname($this->pathPrefix)));
}
}