Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0472dbf

Browse filesBrowse files
committed
bug #34145 [FrameworkBundle] make SodiumVault report bad decryption key accurately (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] make SodiumVault report bad decryption key accurately | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- d9d16d2 [FrameworkBundle] make SodiumVault report bad decryption key accurately
2 parents 0a1de38 + d9d16d2 commit 0472dbf
Copy full SHA for 0472dbf

File tree

1 file changed

+7
-1
lines changed
Filter options

1 file changed

+7
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ public function reveal(string $name): ?string
115115
return null;
116116
}
117117

118-
return sodium_crypto_box_seal_open(include $file, $this->decryptionKey);
118+
if (false === $value = sodium_crypto_box_seal_open(include $file, $this->decryptionKey)) {
119+
$this->lastMessage = sprintf('Secrets cannot be revealed as the wrong decryption key was provided for "%s".', $this->getPrettyPath(\dirname($this->pathPrefix).\DIRECTORY_SEPARATOR));
120+
121+
return null;
122+
}
123+
124+
return $value;
119125
}
120126

121127
public function remove(string $name): bool

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.