File tree 1 file changed +13
-21
lines changed
1 file changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ pub(crate) struct PolicyBuilder {
79
79
}
80
80
81
81
impl PolicyBuilder {
82
- /// Clones the builder, requires the GIL token to increase
83
- /// reference count for `self.store`.
84
82
fn py_clone ( & self , py : pyo3:: Python < ' _ > ) -> PolicyBuilder {
85
83
PolicyBuilder {
86
84
time : self . time . clone ( ) ,
@@ -313,26 +311,20 @@ impl PyClientVerifier {
313
311
py_chain. append ( c. extra ( ) ) ?;
314
312
}
315
313
316
- let subjects = {
317
- // NOTE: The `unwrap()` cannot fail, since the underlying policy
318
- // enforces the well-formedness of the extension set.
319
- let leaf_san_ext = & chain[ 0 ]
320
- . certificate ( )
321
- . extensions ( )
322
- . ok ( )
323
- . unwrap ( )
324
- . get_extension ( & SUBJECT_ALTERNATIVE_NAME_OID ) ;
325
-
326
- match leaf_san_ext {
327
- None => None ,
328
- Some ( leaf_san) => {
329
- let leaf_gns = leaf_san
330
- . value :: < SubjectAlternativeName < ' _ > > ( )
331
- . map_err ( |e| -> CryptographyError { e. into ( ) } ) ?;
332
- let py_gns = parse_general_names ( py, & leaf_gns) ?;
333
- Some ( py_gns)
334
- }
314
+ // NOTE: The `unwrap()` cannot fail, since the underlying policy
315
+ // enforces the well-formedness of the extension set.
316
+ let subjects = match & chain[ 0 ]
317
+ . certificate ( )
318
+ . extensions ( )
319
+ . ok ( )
320
+ . unwrap ( )
321
+ . get_extension ( & SUBJECT_ALTERNATIVE_NAME_OID )
322
+ {
323
+ Some ( leaf_san) => {
324
+ let leaf_gns = leaf_san. value :: < SubjectAlternativeName < ' _ > > ( ) ?;
325
+ Some ( parse_general_names ( py, & leaf_gns) ?)
335
326
}
327
+ None => None ,
336
328
} ;
337
329
338
330
Ok ( PyVerifiedClient {
You can’t perform that action at this time.
0 commit comments