File tree 1 file changed +6
-10
lines changed 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -383,11 +383,6 @@ foreign_type_and_impl_send_sync! {
383
383
pub struct X509Ref ;
384
384
}
385
385
386
- #[ cfg( boringssl) ]
387
- type X509LenTy = c_uint ;
388
- #[ cfg( not( boringssl) ) ]
389
- type X509LenTy = c_int ;
390
-
391
386
impl X509Ref {
392
387
/// Returns this certificate's subject name.
393
388
#[ corresponds( X509_get_subject_name ) ]
@@ -760,15 +755,16 @@ impl X509 {
760
755
let r =
761
756
ffi:: PEM_read_bio_X509 ( bio. as_ptr ( ) , ptr:: null_mut ( ) , None , ptr:: null_mut ( ) ) ;
762
757
if r. is_null ( ) {
763
- let err = ffi:: ERR_peek_last_error ( ) ;
764
- if ffi:: ERR_GET_LIB ( err) as X509LenTy == ffi:: ERR_LIB_PEM
765
- && ffi:: ERR_GET_REASON ( err) == ffi:: PEM_R_NO_START_LINE
758
+ let e = ErrorStack :: get ( ) ;
759
+ let errors = e. errors ( ) ;
760
+ if !errors. is_empty ( )
761
+ && errors[ 0 ] . library_code ( ) == ffi:: ERR_LIB_PEM as libc:: c_int
762
+ && errors[ 0 ] . reason_code ( ) == ffi:: PEM_R_NO_START_LINE as libc:: c_int
766
763
{
767
- ffi:: ERR_clear_error ( ) ;
768
764
break ;
769
765
}
770
766
771
- return Err ( ErrorStack :: get ( ) ) ;
767
+ return Err ( e ) ;
772
768
} else {
773
769
certs. push ( X509 ( r) ) ;
774
770
}
You can’t perform that action at this time.
0 commit comments