PHP-FPM sodium module should have argon2 support.

Started by DA_MAN, December 18, 2021, 06:43:06 PM

Previous topic - Next topic

DA_MAN

The sodium module in PHP-FPM 8.0 (well likely all of them) is not being compiled with argon2 support. We need something like:

./configure --with-password-argon2

Added to the compiler for PHP-FPM. Can anyone comment on this? It is throwing an error for me in Nextcloud due to it.


DA_MAN

php -r 'print_r(get_defined_constants());' | grep -i argon

should output something like:

# php -r 'print_r(get_defined_constants());' | grep -i argon
    [PASSWORD_ARGON2I] => argon2i
    [PASSWORD_ARGON2ID] => argon2id
    [PASSWORD_ARGON2_DEFAULT_MEMORY_COST] => 65536
    [PASSWORD_ARGON2_DEFAULT_TIME_COST] => 4
    [PASSWORD_ARGON2_DEFAULT_THREADS] => 1
    [PASSWORD_ARGON2_PROVIDER] => standard
    [SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13] => 1
    [SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13] => 2
    [SODIUM_CRYPTO_PWHASH_STRPREFIX] => $argon2id$

DA_MAN

Looks like this could just be a PHP configuration requirement and Nextcloud is errantly throwing the sodium module not present error because of it. I am not sure it is sodium-related. Looks like from my post(s) above it is just something that needs to be added to the PHP build.

Namaste

I had a sodium error last week.  I think it appeared when I was trying to switch to php 7.4.24 from 5.6
Listen to everything Pixelpadre says.

DA_MAN

Quote from: Namaste on December 19, 2021, 01:32:58 AM
I had a sodium error last week.  I think it appeared when I was trying to switch to php 7.4.24 from 5.6

It could be because sodium is not supporting PHP RFC: Argon2 Password Hash - aka argon2I for password hashing.

DA_MAN

Oh, duh I see, the PHP-FPM selector doesn't even have argon2 support built into it like the regular PHP does. Could the dev's add support for this in PHP-FPM 8.0?

DA_MAN

Argon2 support is missing in PHP-FPM 7.4 and 8.0 - 7.3 and 8.1 have it. Could we get this added to 7.4 or more particularly PHP-FPM 8.0?

Sandeep

Hi reset the php option to get all options updated probably you didn't see because of old options are selected.

DA_MAN


DA_MAN

Okay, never mind - that worked. Thanks for the guidance.