Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-141907: Better handle support for SHA3 for test_hashlib#141908
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Ansuel commented Nov 24, 2025 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
python-cla-botbot commented Nov 24, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
fee7782 into python:mainUh oh!
There was an error while loading. Please reload this page.
…honGH-141908) * test_hashlib: better handle support for SHA3 It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> * rework the conditional import for all its attrs --------- (cherry picked from commit fee7782) Co-authored-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
GH-141918 is a backport of this pull request to the 3.14 branch. |
…honGH-141908) * test_hashlib: better handle support for SHA3 It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> * rework the conditional import for all its attrs --------- (cherry picked from commit fee7782) Co-authored-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
GH-141919 is a backport of this pull request to the 3.13 branch. |
…-141908) (#141918) gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908) * test_hashlib: better handle support for SHA3 It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. --------- (cherry picked from commit fee7782) Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
…-141908) (#141919) gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908) * test_hashlib: better handle support for SHA3 It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. --------- (cherry picked from commit fee7782) Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
…honGH-141908) * test_hashlib: better handle support for SHA3 It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> * rework the conditional import for all its attrs --------- Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
…honGH-141908) * test_hashlib: better handle support for SHA3 It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one. The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo. To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> * rework the conditional import for all its attrs --------- Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
It's possible that the SSL library supports only SHA3 algo and doesn't have SHAKE one.
The current test wrongly detect this and set both HASH and HASHXOF to None expecting to have the extra SHA3 attributes present but this should only be true for SHAKE algo.
To better handle this, move the HASH condition to a dedicated try-expect condition and check if HASHXOF is None in the relevant code effectively checking if SHA3 is supported by the SSL library but SHAKE algo needs to use the sha3module one.