Skip to content

[FrameworkBundle] allow using secrets when the sodium ext is missing #34275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

nicolas-grekas
Copy link
Member

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

When all secrets are defined as env vars, there is no need for the sodium vault, yet it chokes on instantiation currently.

nicolas-grekas added a commit that referenced this pull request Nov 7, 2019
…is missing (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] allow using secrets when the sodium ext is missing

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

When all secrets are defined as env vars, there is no need for the sodium vault, yet it chokes on instantiation currently.

Commits
-------

326284a [FrameworkBundle] allow using secrets when the sodium ext is missing
@nicolas-grekas nicolas-grekas merged commit 326284a into symfony:4.4 Nov 7, 2019
if (!\function_exists('sodium_crypto_box_seal')) {
$this->lastMessage = sprintf('Secret "%s" cannot be revealed as the "sodium" PHP extension missing. Try running "composer require paragonie/sodium_compat" if you cannot enable the extension."', $name);

return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we return null silently here, or throw an exception when trying to use reveal without the sodium extension ? seal is throwing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should return null, that's the design here - it allows e.g. the env var process to take over and provide a fallback behavior

Copy link
Member

@stof stof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generateKeys is missing the validation (as it catches LogicException throwing by loadKeys and ignore it, this cannot be considered as the validation)

@nicolas-grekas nicolas-grekas deleted the secret-relax branch November 7, 2019 16:16
nicolas-grekas added a commit that referenced this pull request Nov 8, 2019
…as-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 #34275 (review)

Commits
-------

a594599 [FrameworkBundle] fix SodiumVault after stof review
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Nov 8, 2019
…as-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 symfony/symfony#34275 (review)

Commits
-------

a594599078 [FrameworkBundle] fix SodiumVault after stof review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy