GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-135532: simplify handling of HACL* errors in `_hmac` by picnixz · Pull Request #135740 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Jun 20, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

When I first wrote this module, I wanted to be as pedantic as possible. However, the code became overly complex and having a better traceback when getting Hacl_Streaming_Types_InvalidAlgorithm is not really interesting because it should, in practice, never happen.

Hacl_Streaming_Types_InvalidAlgorithm is only returned when we allocate HMAC with BLAKE-2 but... that shouldn't be possible because we're not supporting HMAC-BLAKE (BLAKE is already playing the role of a keyed hash function).

  • Issue: Rewrite & cleanup HACL*-based extension modules #135532

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@picnixz
simplify _hacl_convert_errno
b7a132f
@picnixz
picnixz requested a review from gpshead as a code owner June 20, 2025 08:11
@picnixz picnixz added the skip news label Jun 20, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 20, 2025
@picnixz picnixz added needs backport to 3.14 bugs and security fixes and removed awaiting core review labels Jun 20, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jun 20, 2025
Rewrite & cleanup HACL*-based extension modules #135532
Closed
@picnixz

picnixz commented Jun 20, 2025

Copy link
Copy Markdown
Member Author

!buildbot FIPS only

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jun 20, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @picnixz for commit b7a132f 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135740%2Fmerge

The command will test the builders whose names match following regular expression: FIPS only

The builders matched are:

  • AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PR
  • AMD64 CentOS9 FIPS Only Blake2 Builtin Hash PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz
picnixz merged commit 2dbada1 into python:main Jun 20, 2025
@picnixz
picnixz deleted the refactor/hmac/convert-hacl-errno-135532 branch June 20, 2025 08:57
@miss-islington-app

miss-islington-app Bot commented Jun 20, 2025

Copy link
Copy Markdown

Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 20, 2025
@picnixz @miss-islington
pythongh-135532: simplify handling of HACL* errors in _hmac (python…
fdad74d
…GH-135740)

(cherry picked from commit 2dbada1)

Co-authored-by: Bénédikt Tran <[email protected]>
@bedevere-app

bedevere-app Bot commented Jun 20, 2025

Copy link
Copy Markdown

GH-135743 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 20, 2025
@bedevere-bot

bedevere-bot commented Jun 20, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable 3.x (tier-2) has failed when building commit 2dbada1.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/125/builds/7834) and take a look at the build logs.
  4. Check if the failure is related to this commit (2dbada1) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/125/builds/7834

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/Lib/test/test_perf_profiler.py", line 373, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertEqual(stderr, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 726 events and lost 1[34 chars]\n\n' != ''
- Warning:
- Processed 726 events and lost 1 chunks!
- 
- Check IO/CPU overload!
- 


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/Lib/test/test_perf_profiler.py", line 373, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertEqual(stderr, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 674 events and lost 1[34 chars]\n\n' != ''
- Warning:
- Processed 674 events and lost 1 chunks!
- 
- Check IO/CPU overload!
- 
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz added a commit that referenced this pull request Jun 20, 2025
@miss-islington @picnixz
[3.14] gh-135532: simplify handling of HACL* errors in _hmac (GH-13…
d057cb4
…5740) (#135743)

gh-135532: simplify handling of HACL* errors in `_hmac` (GH-135740)
(cherry picked from commit 2dbada1)

Co-authored-by: Bénédikt Tran <[email protected]>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@picnixz @Pranjal095
pythongh-135532: simplify handling of HACL* errors in _hmac (python…
7a55bd3
…#135740)
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@picnixz @taegyunkim
pythongh-135532: simplify handling of HACL* errors in _hmac (python…
0a9b1bb
…#135740)
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@picnixz @Agent-Hellboy
pythongh-135532: simplify handling of HACL* errors in _hmac (python…
100306b
…#135740)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@picnixz @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.