[php-src] PR #25353: Multiple Argon2-related bugfixes and cleanups (libargon2, openssl)

From: Date: Mon, 09 Nov 2026 21:01:47 +0000
Subject: [php-src] PR #25353: Multiple Argon2-related bugfixes and cleanups (libargon2, openssl)
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-40481@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/25353 Author: narfbg Similar to GH-24302 but for Argon2. ext/password: - password_hash(), password_needs_rehash() no longer accept invalid $options['threads'] ([above 255](https://c2sp.org/phc-strings#argon2-encoding)) - password_verify() no longer calls libargon2 on malformed hashes - password_get_info() no longer parses malformed hashes - Cleanups all around, including fewer heap allocations, but didn't touch the salt handling because that's pending in GH-24281. A couple more nitpicky things can be improved as well, but didn't want to balloon the patch even more upfront. ext/openssl: - [openssl_]password_hash(), [openssl_]password_needs_rehash() no longer accept invalid $options['threads'] values (above 255) - [openssl_]password_verify() no longer triggers computations and/or throws exceptions on hashes with invalid parameters - [openssl_]password_verify() no longer accepts obviously invalid hashes such as with invalid versions or empty salt - [openssl_]password_hash(), [openssl_]password_needs_rehash() no longer throw exceptions for invalid options, to match ext/password - [openssl_]password_hash(), [openssl_]password_verify() no longer confuse the threads option with OpenSSL's internal threads (this might be why --with-openssl-argon2 --enable-zts builds are currently forbidden, but haven't tested) Also (for both) password_needs_rehash() will return true if it sees an older version hash, not just changed parameters. And tests, lots of tests. :slightly_smiling_face: Most of the work I did in ext/password, and tried to keep ext/openssl changes minimal (sscanf() usage still broken), but I do intend to fully fix it up once some decisions are made - whether the same parser approach is ok, exactly which conditions should warrant a rehash, etc. libsodium provider is mostly fine - nothing really broken; only a bit rough around the edges with error messages and obscure but valid Argon2 v.1.0 hashes. Will polish it later probably alongside OpenSSL's remaining issues.

« previous php.git-pulls (#40481) next »