Update for rust rfc 52 changes
This commit is contained in:
parent
cec41181c0
commit
6802216f79
|
|
@ -96,7 +96,7 @@ impl Hasher {
|
|||
pub fn final(&self) -> Vec<u8> {
|
||||
unsafe {
|
||||
let mut res = Vec::from_elem(self.len, 0u8);
|
||||
EVP_DigestFinal(self.ctx, res.as_mut_ptr(), ptr::mut_null());
|
||||
EVP_DigestFinal(self.ctx, res.as_mut_ptr(), ptr::null_mut());
|
||||
res
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ impl PKey {
|
|||
|
||||
fn _fromstr(&mut self, s: &[u8], f: unsafe extern "C" fn(*const *mut RSA, *const *const u8, c_uint) -> *mut RSA) {
|
||||
unsafe {
|
||||
let rsa = ptr::mut_null();
|
||||
let rsa = ptr::null_mut();
|
||||
f(&rsa, &s.as_ptr(), s.len() as c_uint);
|
||||
EVP_PKEY_set1_RSA(self.evp, rsa);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ impl SslContext {
|
|||
init();
|
||||
|
||||
let ctx = unsafe { ffi::SSL_CTX_new(method.to_raw()) };
|
||||
if ctx == ptr::mut_null() {
|
||||
if ctx == ptr::null_mut() {
|
||||
return Err(SslError::get());
|
||||
}
|
||||
|
||||
|
|
@ -296,18 +296,18 @@ impl Drop for Ssl {
|
|||
impl Ssl {
|
||||
pub fn new(ctx: &SslContext) -> Result<Ssl, SslError> {
|
||||
let ssl = unsafe { ffi::SSL_new(ctx.ctx) };
|
||||
if ssl == ptr::mut_null() {
|
||||
if ssl == ptr::null_mut() {
|
||||
return Err(SslError::get());
|
||||
}
|
||||
let ssl = Ssl { ssl: ssl };
|
||||
|
||||
let rbio = unsafe { ffi::BIO_new(ffi::BIO_s_mem()) };
|
||||
if rbio == ptr::mut_null() {
|
||||
if rbio == ptr::null_mut() {
|
||||
return Err(SslError::get());
|
||||
}
|
||||
|
||||
let wbio = unsafe { ffi::BIO_new(ffi::BIO_s_mem()) };
|
||||
if wbio == ptr::mut_null() {
|
||||
if wbio == ptr::null_mut() {
|
||||
unsafe { ffi::BIO_free_all(rbio) }
|
||||
return Err(SslError::get());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue