Bug 1980477

Summary: RFE: Add yescrypt support to PHP password_hash() and password_verify()
Product: Red Hat Enterprise Linux 9 Reporter: Rajesh Dulhani <rdulhani>
Component: phpAssignee: Remi Collet <rcollet>
Status: CLOSED MIGRATED QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: aboscatt, jorton, pbrezina, rcollet, redhat-bugzilla, robert.scheck, sujagtap
Target Milestone: betaKeywords: FutureFeature, MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 20:27:21 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rajesh Dulhani 2021-07-08 17:32:57 UTC
> 1. Proposed a title of this feature request.

Add yescrypt support to PHP password_hash() and password_verify()

> 2. Why do you need this feature? (List the business requirements here)

As of writing, PHP password_hash() and password_verify() implement the same hashing mechanisms like UNIX /etc/shadow file with the exception of yescrypt as it currently seems. However for our future PHP-based web applications we would like to use the resistance benefits of yescrypt also there. So it's basically https://fedoraproject.org/wiki/Changes/yescrypt_as_default_hashing_method_for_shadow but for the PHP password functions.

> 3. How does the presence/absence of this feature benefits/impacts your Business/project operation? If so, Kindly provide a justification regarding the benefits/impact which is important for filing.

If we can't use yescrypt in PHP password_hash() and password_verify() we would have to stay with bcrypt further on (and it's known disadvantages as mentioned at https://fedoraproject.org/wiki/Changes/yescrypt_as_default_hashing_method_for_shadow). Given we also develop security-sensitive applications for the public sector and/or governmental organizations, we would like to have the maximum resistance.

> 4. How would you like to achieve this? (List the functional requirements)

Extension of existing hashing mechanisms in PHP password_hash() and password_verify() with yescrypt in PHP upstream by Red Hat (not sure if Remi Collet can maybe implement this, but he is at least a very experienced PHP maintainer).

> 5. How quickly does this need to be resolved for you?

RHEL 9.0 GA

> 6. Are you able to assist in testing this functionality if implemented?

Yes, of course!

Comment 4 Remi Collet 2021-10-15 08:42:58 UTC
Upstream PHP only supports PASSWORD_BCRYPT (default) and optionally PASSWORD_ARGON2I / PASSWORD_ARGON2ID (not available in RHEL)

As yescript support is not available upstream, it makes sense to work upstream first to possibly add it there (PHP 8.2 ?) which will require lot of changes, and probably a RFC (PHP new feature process)
Then if approved, it will be possible to add it later to our build.

Comment 5 Remi Collet 2021-10-15 09:06:16 UTC
Step 1  https://github.com/php/php-src/pull/7580

Comment 9 Remi Collet 2022-03-07 10:38:06 UTC
There is, for now, no upstream plan to add this support
I don't think we want to diverge from upstream
If this happens sometime in the future, it will be part of a new PHP major version (8.2, 8.3...)

Comment 10 Robert Scheck 2022-06-17 09:53:46 UTC
(In reply to Remi Collet from comment #9)
> There is, for now, no upstream plan to add this support
> I don't think we want to diverge from upstream
> If this happens sometime in the future, it will be part of a new PHP major
> version (8.2, 8.3...)

My expectation was never to diverge from upstream but to get this into upstream (with the help of somebody like you, Remi).

As of writing, https://github.com/php/php-src/pull/7580 got closed and https://github.com/php/php-src/pull/7584 seems to be the merged successor (for master and PHP 8.1). Thus this should land in upstream PHP 8.1, correct? And a possible future PHP 8.1 or 8.2 for RHEL 9 should then have a chance to provide this feature?

Comment 13 RHEL Program Management 2023-09-21 20:11:33 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 14 RHEL Program Management 2023-09-21 20:27:21 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.

Comment 15 Red Hat Bugzilla 2024-01-20 04:25:09 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days