Tim Düsterhus
c59e0750af
password: Use php_random_bytes_throw in php_password_make_salt ( #10393 )
...
The CSPRNG failing should be rare nowadays, but it *might* happen and without
this patch it's hard for the user to find out why the salt generation failed:
The error message is not actionable.
This patch will automatically set the CSPRNG exception to the `$previous`
exception of the ValueError that is thrown, allowing the developer to determine
the cause of the salt generation failure.
Before:
Fatal error: Uncaught ValueError: Unable to generate salt in php-src/test3.php:3
Stack trace:
#0 php-src/test3.php(3): password_hash(Object(SensitiveParameterValue), '2y')
#1 {main}
thrown in php-src/test3.php on line 3
After:
Fatal error: Uncaught Random\RandomException: Cannot open /dev/urandom: No such file or directory in php-src/test3.php:3
Stack trace:
#0 php-src/test3.php(3): password_hash(Object(SensitiveParameterValue), '2y')
#1 {main}
Next ValueError: Unable to generate salt in php-src/test3.php:3
Stack trace:
#0 php-src/test3.php(3): password_hash(Object(SensitiveParameterValue), '2y')
#1 {main}
thrown in php-src/test3.php on line 3
2023-01-23 18:35:16 +01:00
..
2021-05-06 12:16:35 +02:00
2021-12-15 20:27:40 +01:00
2023-01-23 12:28:21 +00:00
2023-01-23 10:52:14 +01:00
2022-10-12 08:16:19 +02:00
2022-08-09 12:45:14 +02:00
2021-05-06 12:16:35 +02:00
2022-10-13 13:13:36 +02:00
2023-01-16 12:27:33 +01:00
2022-07-19 10:27:38 +01:00
2022-10-13 13:13:36 +02:00
2021-10-05 09:51:58 +01:00
2022-09-04 15:00:43 +02:00
2022-08-09 16:22:14 +02:00
2022-02-24 16:14:47 +01:00
2022-07-22 12:46:11 +01:00
2021-07-03 21:03:47 +02:00
2022-07-19 17:45:15 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-05-23 19:06:41 +01:00
2022-05-23 19:06:41 +01:00
2022-07-04 12:56:01 +01:00
2022-07-04 12:56:01 +01:00
2022-10-12 12:07:03 +02:00
2022-07-20 17:18:34 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-08-19 10:39:23 +02:00
2022-11-28 17:12:07 +01:00
2021-08-19 10:39:23 +02:00
2022-11-09 17:51:45 +01:00
2021-05-06 12:16:35 +02:00
2022-09-02 15:04:49 +02:00
2023-01-16 12:27:33 +01:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2022-09-10 18:12:22 +02:00
2022-12-07 19:57:50 +01:00
2022-07-08 12:11:05 +01:00
2022-09-10 18:12:22 +02:00
2022-11-16 12:58:24 +00:00
2023-01-16 12:54:35 +00:00
2022-04-01 15:48:41 +01:00
2022-04-01 15:48:41 +01:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2022-04-01 15:48:41 +01:00
2022-08-11 16:27:25 +01:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-09-30 13:51:18 +02:00
2022-09-30 13:51:18 +02:00
2022-08-18 12:31:56 +02:00
2023-01-15 16:00:18 +00:00
2022-09-02 16:07:25 +02:00
2021-06-29 11:30:26 +02:00
2022-09-30 13:51:18 +02:00
2021-05-06 12:16:35 +02:00
2022-05-13 23:30:20 +01:00
2021-05-06 12:16:35 +02:00
2023-01-23 12:28:21 +00:00
2023-01-23 10:52:14 +01:00
2021-03-16 14:22:25 +01:00
2023-01-16 12:27:33 +01:00
2023-01-16 12:25:59 +01:00
2023-01-16 12:25:59 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2022-08-15 19:49:24 +01:00
2021-05-06 12:16:35 +02:00
2022-05-22 16:13:44 +01:00
2021-05-06 12:16:35 +02:00
2023-01-23 18:35:16 +01:00
2022-08-24 16:09:48 +02:00
2022-10-12 08:16:19 +02:00
2021-05-06 12:16:35 +02:00
2022-09-29 20:40:33 +01:00
2022-09-29 20:40:16 +01:00
2022-10-12 12:07:03 +02:00
2021-09-07 10:04:00 +02:00
2022-09-02 15:04:49 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2023-01-15 16:00:18 +00:00
2022-09-02 16:07:25 +02:00
2021-05-06 12:16:35 +02:00
2022-07-19 10:27:38 +01:00
2023-01-23 10:52:14 +01:00
2021-05-06 12:16:35 +02:00
2022-07-19 10:27:38 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2022-07-19 10:27:38 +01:00
2022-07-19 10:27:38 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-07-19 10:27:38 +01:00
2022-10-13 13:13:36 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-23 10:52:14 +01:00
2021-08-11 14:51:55 +02:00
2021-06-29 11:30:26 +02:00
2021-05-06 12:16:35 +02:00
2021-05-12 18:58:44 +01:00
2021-05-06 12:16:35 +02:00
2022-07-28 22:29:42 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2023-01-23 13:25:00 +00:00
2022-04-23 12:15:13 +01:00
2022-09-02 12:41:51 +02:00
2021-09-01 16:58:46 +02:00
2022-07-19 10:27:38 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2022-09-23 19:44:29 +02:00
2021-05-06 12:16:35 +02:00
2022-10-12 13:04:14 +02:00
2022-10-12 13:04:14 +02:00
2022-10-12 13:04:14 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2023-01-23 10:52:14 +01:00
2021-06-29 11:30:26 +02:00