Skip to content
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

hmac internals: Make it clearer that Context::try_sign doesn't panic. #2192

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

briansmith
Copy link
Owner

Use Digest::try_finish() instead of Digest::finish().

Calculate num_pending directly from the inner digest, so that the compiler can use OutputLen range analysis to prove that the buffer is large enough.

@briansmith briansmith self-assigned this Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.91%. Comparing base (08832ab) to head (c85a1a4).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2192      +/-   ##
==========================================
- Coverage   96.91%   96.91%   -0.01%     
==========================================
  Files         154      154              
  Lines       20239    20240       +1     
  Branches      461      461              
==========================================
  Hits        19615    19615              
  Misses        520      520              
- Partials      104      105       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Use `Digest::try_finish()` instead of `Digest::finish()`.

Calculate `num_pending` directly from the inner digest, so that the
compiler can use `OutputLen` range analysis to prove that the buffer
is large enough.
@briansmith briansmith changed the title hmac internals: Clarify panic safety of Context::try_sign. hmac internals: Make it clearer that Context::try_sign doesn't panic. Dec 18, 2024
@briansmith briansmith merged commit a8619bc into main Dec 19, 2024
158 checks passed
@briansmith briansmith deleted the b/try_sign-panic branch December 19, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant