php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76360 PASSWORD_ARGON2I is an undefined constant
Submitted: 2018-05-20 23:13 UTC Modified: 2018-06-24 04:25 UTC
Votes:16
Avg. Score:4.6 ± 0.7
Reproduced:14 of 14 (100.0%)
Same Version:6 (42.9%)
Same OS:3 (21.4%)
From: jr at geeshoe dot com Assigned:
Status: No Feedback Package: *Encryption and hash functions
PHP Version: 7.2.5 OS: Debian 9
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jr at geeshoe dot com
New email:
PHP Version: OS:

 

 [2018-05-20 23:13 UTC] jr at geeshoe dot com
Description:
------------
When attempting to use password_hash with PASSWORD_ARGON2I as the algo, PHP throws 2 warnings.
1 - Undefined constant PASSWORD_ARGON2I
2 - password_hash() expects parameter 2 to be integer, string given.

Test script:
---------------
<?php
echo phpversion();
echo password_hash('password', PASSWORD_ARGON2I);

Expected result:
----------------
7.2.5
...some hash....

Actual result:
--------------
/usr/local/bin/php /-REDACTED-/test.php
7.2.5
Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /-REDACTED-/test.php on line 3

PHP Warning:  Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /-REDACTED-/test.php on line 3
Call Stack:
PHP Stack trace:
    0.0001     387040   1. {main}() /-REDACTED-/test.php:0
PHP   1. {main}() /-REDACTED-/test.php:0

PHP Warning:  password_hash() expects parameter 2 to be integer, string given in /-REDACTED-/test.php on line 3

PHP Stack trace:
Warning: password_hash() expects parameter 2 to be integer, string given in /-REDACTED-/test.php on line 3

PHP   1. {main}() /-REDACTED-/test.php:0
PHP   2. password_hash() /-REDACTED-/test.php:3
Call Stack:
    0.0001     387040   1. {main}() /-REDACTED-/test.php:0
    0.0001     387072   2. password_hash() /-REDACTED-/test.php:3


Process finished with exit code 0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-20 23:52 UTC] Danack at basereality dot com
PASSWORD_ARGON2I will only be available if PHP was compiled against the Argon 2 library.

How did you install PHP? If it's from someone's repo, you might need to ask them to include it.
 [2018-05-21 02:22 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2018-06-24 04:25 UTC] 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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 05:01:31 2024 UTC