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

chacha20_poly1305_openssh: Minimize and document panicking. #2228

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

briansmith
Copy link
Owner

See the individual commit messages for details.

@briansmith briansmith self-assigned this Jan 16, 2025
Return an error instead of panicking. Luckily, since the slicing
is done after the Poly1305 verification is done, it won't be hit
by anybody in practice unless Poly1305 is broken. Unfortunately,
for the same reason, it is too hard to write a test.

Also, the user will have needed to have already decrypted the
packet length before calling `open_in_place`, which means they
must have successfully parsed a packet length.
@briansmith briansmith merged commit 837b4e5 into main Jan 16, 2025
162 checks passed
@briansmith briansmith deleted the b/avoid-panic-min branch January 16, 2025 17:44
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 97.01%. Comparing base (0223acb) to head (4f65d89).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/aead/chacha20_poly1305_openssh.rs 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2228   +/-   ##
=======================================
  Coverage   97.01%   97.01%           
=======================================
  Files         165      165           
  Lines       20500    20505    +5     
  Branches      463      464    +1     
=======================================
+ Hits        19888    19893    +5     
- Misses        504      505    +1     
+ Partials      108      107    -1     

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

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