-
Notifications
You must be signed in to change notification settings - Fork 52
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
deps: rcgen 0.12 -> 0.13 #239
Conversation
cpu
commented
Mar 28, 2024
- updates rcgen dev dependency to 0.13
- fixes breaking upstream changes
- also fixes an unrelated nightly clippy err in a separate commit
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #239 +/- ##
==========================================
+ Coverage 97.19% 97.22% +0.02%
==========================================
Files 19 19
Lines 4065 4104 +39
==========================================
+ Hits 3951 3990 +39
Misses 114 114 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can take more advantage of the impl From<Certificate> for CertificateDer<'static>
that we have in rcgen... called out a bunch of places but it looks like there are a lot more.
This comment was marked as resolved.
This comment was marked as resolved.
Oh, so we don't have ownership of the |
We have ownership. I'll try again 🤔 |
I don't think there's any way to do this without Code and error: #[test]
fn test_it() {
let cert_and_key: rcgen::CertifiedKey = make_issuer("Bogus Subject");
let cert: rcgen::Certificate = cert_and_key.cert;
let cert_der_borrowed: &CertificateDer<'static> = cert.der();
let cert_der_owned: CertificateDer<'static> = cert_der_borrowed.into_owned();
}
|
Maybe in rcgen |
Or, maybe what we should have done was to return a pub fn der<'a>(&'a self) -> CertificateDer<'a> {
CertificateDer::from(self.der.as_ref())
} Edit: Something like cpu/rcgen@2069697 (but probably added as a second fn since we don't want to make a 0.14...... 😭) Edit 2: It ends up looking like this on our side: dc2d224 I think it's a big improvement. I just wish we noticed this before 0.13 😭 😭 |
That looks like you are not using the |
(It's late here so my brain is too fried to go deep on this.) |
I'm not sure what you mean, but in either case this would be separate from the problem I was trying to solve w.r.t How would you adjust the smaller snippet I shared if you don't think |
Like this? #[test]
fn test_it() {
use pki_types::CertificateDer;
let cert_and_key: rcgen::CertifiedKey = make_issuer("Bogus Subject");
let cert: rcgen::Certificate = cert_and_key.cert;
let cert_der_borrowed: &CertificateDer<'static> = cert.der();
let cert_der_owned = CertificateDer::from(cert);
} |
Ohhhhh! I see, not using I'll rework this & rustls/rustls#1852 with my new understanding. |
When I added the |
5aa738e
to
4659b92
Compare
Updated to remove almost all of the clunky |
``` warning: bound is defined in more than one place --> src/verify_cert.rs:553:35 | 553 | fn loop_while_non_fatal_error<'a, V: 'a>( | ^ ... 559 | V: IntoIterator, | ^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations = note: `#[warn(clippy::multiple_bound_locations)]` on by default ```
* top-down * tests before helpers
To support splitting off the "building" part we need to emphasize these two fns are both building _and_ verifying paths.
* updates rcgen dev dependency to 0.13 * fixes breaking upstream changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some thoughts on further improvements, but let's get this in.
@ctz Is this a branch you'd like to review before it lands? |
Since this is only touching test & support code I'm going to merge and if there's any more feedback I'll look at follow-up PRs. Thanks! |