Bug #81476 [NoF->Dup]: "with-password-argon2" does build but not work
Edit report at https://bugs.php.net/bug.php?id=81476&edit=1
ID: 81476
Updated by: nikic@php.net
Reported by: s dot grindau at smart-media-gmbh dot de
Summary: "with-password-argon2" does build but not work
-Status: No Feedback
+Status: Duplicate
Type: Bug
Package: *Compile Issues
Operating System: Arch Linux X64
PHP Version: 8.1.0RC2
Block user comment: N
Private report: N
New Comment:
This is the same issue as bug #81491, which has been fixed in the meantime.
Previous Comments:
------------------------------------------------------------------------
[2021-10-10 04:22:18] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2021-09-27 19:06:55] s dot grindau at smart-media-gmbh dot de
i could of course check for
definition of the constant "PASSWORD_ARGON2_DEFAULT_THREADS".
but this does not solve the solution of the compilation process.
latest 8.0 builds fine, i tried adding libargon to configure with no success.
configure should fail imho if its unable to find it.
so this new "feature" is buggy at lease on my Arch machine.
------------------------------------------------------------------------
[2021-09-25 13:19:37] Danack at basereality dot com
> but crashed because of the $options['threads' => 8 ]
Apparently you should be checking for whether the PASSWORD_ARGON2_DEFAULT_THREADS constant is
defined, to know if the options for that function supports a 'threads' setting, and only
set it if it's available:
if(defined('PASSWORD_ARGON2_DEFAULT_THREADS'))
{
// Set the number of threads
...
}
https://stackoverflow.com/a/69326446/778719
------------------------------------------------------------------------
[2021-09-24 18:46:49] Danack at basereality dot com
There was a change in how the location of libargon2 was detected: https://github.com/php/php-src/blob/bec1d2f290b153061fe1be6972ac59c3afc4e253/UPGRADING#L593-L596
"--with-password-argon2 now uses pkg-config to detect libargon2. As such,
an alternative libargon2 location should now be specified using
PKG_CONFIG_PATH."
If configure doesn't find where it is, you may need to tell configure the path that it is
installed on.
Possibly related https://bugs.php.net/bug.php?id=80407
There should be info in the config.log about how libargon2 wasn't found...which might say what
package config is returning.
------------------------------------------------------------------------
[2021-09-24 17:45:40] s dot grindau at smart-media-gmbh dot de
Description:
------------
compiling from source with "with-password-argon2" results in argon2 not beeing available.
after compiling 8.0.11
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
after compiling 8.1.0RC1 OR 8.1.0RC2
php -r 'print_r(get_defined_constants());' | grep -i argon
-> nothing!
i tried one build with sodium, which then showed argon2 because i found a hint on stackoverflow
which then had the constants available but crashed because of the $options['threads' =>
8 ], because it supports only one thread.
However i wanted to use it like before without sodium, etc.
I have to say that i am not THAT experienced in building php from source. However other builds from
the stable releases work with the same configure options and i havent a bugreport about this (yet).
Thank you.
Test script:
---------------
./configure \
--disable-all \
--with-password-argon2 \
...
make -j32
sudo make install
Expected result:
----------------
I expected the argon2id constants to be available and the password_hash() function to work like it
ever did.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81476&edit=1
Thread (7 messages)