Unverified Commit 5aadcab9 authored by Steven Fackler's avatar Steven Fackler
Browse files

cleanup

parent d6a92dfd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -408,9 +408,10 @@ cfg_if! {
        }
    }
}

#[cfg(ossl102)]
pub unsafe fn SSL_add1_chain_cert(ssl: *mut ::SSL, ptr: *mut c_void) -> c_long {
    SSL_ctrl(ssl, SSL_CTRL_CHAIN_CERT, 1, ptr)
pub unsafe fn SSL_add0_chain_cert(ssl: *mut ::SSL, ptr: *mut X509) -> c_long {
    SSL_ctrl(ssl, SSL_CTRL_CHAIN_CERT, 0, ptr as *mut c_void)
}

#[cfg(ossl102)]
+6 −6
Original line number Diff line number Diff line
@@ -3104,15 +3104,15 @@ impl SslRef {
            }
        }
    }
    #[corresponds(SSL_add1_chain_cert)]

    #[corresponds(SSL_add0_chain_cert)]
    #[cfg(ossl102)]
    pub fn add_chain_cert(&mut self, chain: X509) -> Result<(), ErrorStack> {
        let ret = unsafe { ffi::SSL_add1_chain_cert(self.as_ptr(), chain.as_ptr() as *mut _) };
        if ret == 1 {
            Ok(())
        } else {
            Err(ErrorStack::get())
        unsafe {
            cvt(ffi::SSL_add0_chain_cert(self.as_ptr(), chain.as_ptr()) as c_int).map(|_| ())?;
            mem::forget(chain);
        }
        Ok(())
    }
}