New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hash() function hangs endlessly if using sha512 on strings >= 4GiB #12936
Labels
Comments
nielsdos
added
Extension: hash
Status: Verified
and removed
Status: Needs Triage
labels
Dec 11, 2023
Looks like it's using |
nielsdos
added a commit
to nielsdos/php-src
that referenced
this issue
Dec 11, 2023
…trings >= 4GiB There's two problems: - Some loops used `unsigned int` instead of `size_t`. - The 2*N-bit addition that is emulated using 2 N bit numbers has a bug: it first truncated the number to 32/64 bit and only then shifted. This resulted in the wrong length info stored inside the resulting hash.
nielsdos
added a commit
to nielsdos/php-src
that referenced
this issue
Dec 11, 2023
…trings >= 4GiB There's two problems: - Some loops used `unsigned int` instead of `size_t`. - The 2*N-bit addition that is emulated using 2 N bit numbers has a bug: it first truncated the number to 32/64 bit and only then shifted. This resulted in the wrong length info stored inside the resulting hash.
nielsdos
added a commit
that referenced
this issue
Dec 12, 2023
* PHP-8.2: Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB
nielsdos
added a commit
that referenced
this issue
Dec 12, 2023
* PHP-8.3: Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The following script hangs endlessly.
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 8.2.10-2ubuntu1 (cli) (built: Sep 5 2023 14:37:47) (NTS)
Operating System
KUbuntu 23.10
The text was updated successfully, but these errors were encountered: