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

Flatten PKI error variants #792

Merged
merged 1 commit into from
Jul 31, 2021
Merged

Flatten PKI error variants #792

merged 1 commit into from
Jul 31, 2021

Conversation

djc
Copy link
Member

@djc djc commented Jul 25, 2021

This gets rid of the WebPkiError and WebPkiOp types in favor of a small number of Error variants:

  • InvalidCertificateEncoding -- represents BadDer and BadDerTime
  • InvalidCertificateSignature -- represents InvalidSignatureForPublicKey
  • InvalidCertificateSignatureType -- represents UnsupportedSignatureAlgorithm and UnsupportedSignatureAlgorithmForPublicKey
  • InvalidCertificateData

This plays off of the distinctions useful to the bogo test suite as well as the need to send a different alert for invalid encoding errors.

Alternatively, we could still combine this with WebPkiOp. However, my feeling is that WebPkiOp doesn't quite carry its weight.

Fixes #782.

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2021

Codecov Report

Merging #792 (432ed5e) into main (b84721e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #792      +/-   ##
==========================================
- Coverage   96.53%   96.52%   -0.01%     
==========================================
  Files          57       57              
  Lines        9230     9104     -126     
==========================================
- Hits         8910     8788     -122     
+ Misses        320      316       -4     
Impacted Files Coverage Δ
rustls/src/lib.rs 100.00% <ø> (ø)
rustls/src/client/hs.rs 97.63% <100.00%> (ø)
rustls/src/error.rs 98.01% <100.00%> (-0.22%) ⬇️
rustls/src/verify.rs 74.88% <100.00%> (+0.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b84721e...432ed5e. Read the comment docs.

@ctz ctz merged commit e9afee0 into rustls:main Jul 31, 2021
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.

Replace WebPkiError/WebPkiOp with a more general mechanism
3 participants