File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -475,14 +475,10 @@ mod test {
475
475
// check verification result - this is an invalid signature
476
476
// defined in openssl crypto/cms/cms.h
477
477
const CMS_R_CERTIFICATE_VERIFY_ERROR : i32 = 100 ;
478
- match res {
479
- Err ( es) => {
480
- let error_array = es. errors ( ) ;
481
- assert_eq ! ( 1 , error_array. len( ) ) ;
482
- let code = error_array[ 0 ] . code ( ) ;
483
- assert_eq ! ( ffi:: ERR_GET_REASON ( code) , CMS_R_CERTIFICATE_VERIFY_ERROR ) ;
484
- }
485
- _ => panic ! ( "expected CMS verification error, got Ok()" ) ,
486
- }
478
+ let es = res. unwrap_err ( ) ;
479
+ let error_array = es. errors ( ) ;
480
+ assert_eq ! ( 1 , error_array. len( ) ) ;
481
+ let code = error_array[ 0 ] . reason_code ( ) ;
482
+ assert_eq ! ( code, CMS_R_CERTIFICATE_VERIFY_ERROR ) ;
487
483
}
488
484
}
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ impl Provider {
55
55
retain_fallbacks as _ ,
56
56
) ) ?;
57
57
58
+ // OSSL_PROVIDER_try_load seems to leave errors on the stack, even
59
+ // when it succeeds.
60
+ let _ = ErrorStack :: get ( ) ;
61
+
58
62
Ok ( Provider :: from_ptr ( p) )
59
63
}
60
64
}
You can’t perform that action at this time.
0 commit comments