briansmith / ring

Safe, fast, small crypto using Rust
Other
3.68k stars 693 forks source link

rsa/der: Make it clearer that ASN.1 serialization is panic-free and lossless. #1955

Closed briansmith closed 6 months ago

briansmith commented 6 months ago

Eliminate as conversions and an unreachable. See the individual commits for details.

codecov[bot] commented 6 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (fa98b49) 96.23% compared to head (22ea593) 96.25%. Report is 1 commits behind head on main.

Files Patch % Lines
src/io/der_writer.rs 96.77% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1955 +/- ## ========================================== + Coverage 96.23% 96.25% +0.01% ========================================== Files 135 135 Lines 20656 20667 +11 Branches 226 226 ========================================== + Hits 19879 19892 +13 + Misses 743 741 -2 Partials 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

briansmith commented 6 months ago

codecov rightly reports that we're not testing the case where we need to serialize the high byte of the length. To do this, we need to add a test that constructs a 4096-bit RrsaKeyPair.

briansmith commented 6 months ago

Replaced by #1959.