Skip to content
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

Indicates that sodium extension is provided #156

Closed
wants to merge 2 commits into from
Closed

Indicates that sodium extension is provided #156

wants to merge 2 commits into from

Conversation

cedric-anne
Copy link

@cedric-anne cedric-anne commented Mar 18, 2023

Hi,

Adding the "provide": {"ext-sodium": "*"} will permit to install a dependency that requires this extension without actually having it installed.

This is working since version 2 of composer.

Here is an exemple of requirements checks result. I truncated it to keep only usefull information

$ composer check-platform-reqs            
ext-ctype            *        success provided by symfony/polyfill-ctype    
ext-curl             8.1      success
ext-mbstring         *        success provided by symfony/polyfill-mbstring 
ext-mysqli           8.1.16   success                                       
ext-sodium           n/a      lcobucci/jwt requires ext-sodium (*)      missing                                       

ext-ctype and ext-mbstring are not installed on the machine but checks are passing due to provide instructions added in symfony/polyfill#374

@cedric-anne cedric-anne changed the title Indicates that ext-sodium extension is provided Indicates that sodium extension is provided Mar 18, 2023
@paragonie-security
Copy link
Contributor

This change might be problematic.

Some software specifies ext-sodium specifically because sodium_compat doesn't provide an Argon2 polyfill. (Nor can it.)

If you want to work around this, a separate Composer package that simply requires sodium-compat and specifies the provides flag would hack around this for projects that desire this, without upsetting the expectations of downstream libraries.

@paragonie-security
Copy link
Contributor

https://github.com/paragonie/sodium_compat_ext_sodium - We created a meta-package for this here.

@cedric-anne
Copy link
Author

Some software specifies ext-sodium specifically because sodium_compat doesn't provide an Argon2 polyfill. (Nor can it.)

Indeed, it may be a problem when paragonie/sodium_compat is indirectly added to dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants