briansmith / ring

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

RSA internals: Make it clearer that serializing the public key won't panic. #1959

Closed briansmith closed 5 months ago

briansmith commented 6 months ago

RsaKeyPair rejects keys that are so large that they can't be serialized by the DER writer, so no panic will happen. However, this is far from obvious, so just make the DER writer fallible instead of having it panic.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 96.29%. Comparing base (6331d46) to head (1a2f210).

Files Patch % Lines
src/io/writer.rs 85.00% 3 Missing :warning:
src/io/der_writer.rs 95.45% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1959 +/- ## ========================================== - Coverage 96.29% 96.29% -0.01% ========================================== Files 135 135 Lines 20663 20677 +14 Branches 226 226 ========================================== + Hits 19898 19910 +12 - Misses 730 733 +3 + Partials 35 34 -1 ```

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