Loading openssl/src/asn1.rs +1 −3 Original line number Diff line number Diff line Loading @@ -59,9 +59,7 @@ impl Asn1StringRef { } pub fn len(&self) -> usize { unsafe { ffi::ASN1_STRING_length(self.as_ptr()) as usize } unsafe { ffi::ASN1_STRING_length(self.as_ptr()) as usize } } } Loading openssl/src/bn.rs +3 −13 Original line number Diff line number Diff line Loading @@ -365,22 +365,12 @@ impl BigNumRef { /// * `bits`: Length of the number in bits. /// * `msb`: The desired properties of the number. /// * `odd`: If `true`, the generated number will be odd. pub fn rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_rand(self.as_ptr(), bits.into(), msb.0, odd as c_int)).map(|_| ()) } pub fn rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_rand(self.as_ptr(), bits.into(), msb.0, odd as c_int)).map(|_| ()) } } /// The cryptographically weak counterpart to `rand`. pub fn pseudo_rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { pub fn pseudo_rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_pseudo_rand(self.as_ptr(), bits.into(), msb.0, odd as c_int)).map(|_| ()) } Loading openssl/src/ssl/connector.rs +2 −5 Original line number Diff line number Diff line Loading @@ -215,9 +215,7 @@ fn get_dh() -> Result<Dh, ErrorStack> { use types::OpenSslType; // manually call into ffi to avoid forcing the features unsafe { cvt_p(ffi::DH_get_2048_256()).map(|p| Dh::from_ptr(p)) } unsafe { cvt_p(ffi::DH_get_2048_256()).map(|p| Dh::from_ptr(p)) } } #[cfg(ossl101)] Loading Loading @@ -302,8 +300,7 @@ mod verify { } } fn verify_subject_alt_names(domain: &str, names: Stack<GeneralName>) -> bool { fn verify_subject_alt_names(domain: &str, names: Stack<GeneralName>) -> bool { let ip = domain.parse(); for name in &names { Loading openssl/src/stack.rs +7 −10 Original line number Diff line number Diff line Loading @@ -226,7 +226,8 @@ impl<'a, T: Stackable> iter::IntoIterator for &'a mut Stack<T> { /// An iterator over the stack's contents. pub struct Iter<'a, T: Stackable> where T: 'a { where T: 'a { stack: &'a StackRef<T>, pos: usize, } Loading @@ -251,8 +252,7 @@ impl<'a, T: Stackable> iter::Iterator for Iter<'a, T> { } } impl<'a, T: Stackable> iter::ExactSizeIterator for Iter<'a, T> { } impl<'a, T: Stackable> iter::ExactSizeIterator for Iter<'a, T> {} /// A mutable iterator over the stack's contents. pub struct IterMut<'a, T: Stackable + 'a> { Loading @@ -272,9 +272,7 @@ impl<'a, T: Stackable> iter::Iterator for IterMut<'a, T> { // guarantee that we won't return several references to // the same object, so we have to use unsafe code for // mutable iterators. let n = unsafe { Some(T::Ref::from_ptr_mut(self.stack._get(self.pos))) }; let n = unsafe { Some(T::Ref::from_ptr_mut(self.stack._get(self.pos))) }; self.pos += 1; Loading @@ -289,5 +287,4 @@ impl<'a, T: Stackable> iter::Iterator for IterMut<'a, T> { } } impl<'a, T: Stackable> iter::ExactSizeIterator for IterMut<'a, T> { } impl<'a, T: Stackable> iter::ExactSizeIterator for IterMut<'a, T> {} openssl/src/x509/mod.rs +2 −3 Original line number Diff line number Diff line Loading @@ -513,9 +513,8 @@ impl<'a> Iterator for X509NameEntries<'a> { fn next(&mut self) -> Option<&'a X509NameEntryRef> { unsafe { self.loc = ffi::X509_NAME_get_index_by_NID(self.name.as_ptr(), self.nid.as_raw(), self.loc); self.loc = ffi::X509_NAME_get_index_by_NID(self.name.as_ptr(), self.nid.as_raw(), self.loc); if self.loc == -1 { return None; Loading Loading
openssl/src/asn1.rs +1 −3 Original line number Diff line number Diff line Loading @@ -59,9 +59,7 @@ impl Asn1StringRef { } pub fn len(&self) -> usize { unsafe { ffi::ASN1_STRING_length(self.as_ptr()) as usize } unsafe { ffi::ASN1_STRING_length(self.as_ptr()) as usize } } } Loading
openssl/src/bn.rs +3 −13 Original line number Diff line number Diff line Loading @@ -365,22 +365,12 @@ impl BigNumRef { /// * `bits`: Length of the number in bits. /// * `msb`: The desired properties of the number. /// * `odd`: If `true`, the generated number will be odd. pub fn rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_rand(self.as_ptr(), bits.into(), msb.0, odd as c_int)).map(|_| ()) } pub fn rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_rand(self.as_ptr(), bits.into(), msb.0, odd as c_int)).map(|_| ()) } } /// The cryptographically weak counterpart to `rand`. pub fn pseudo_rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { pub fn pseudo_rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_pseudo_rand(self.as_ptr(), bits.into(), msb.0, odd as c_int)).map(|_| ()) } Loading
openssl/src/ssl/connector.rs +2 −5 Original line number Diff line number Diff line Loading @@ -215,9 +215,7 @@ fn get_dh() -> Result<Dh, ErrorStack> { use types::OpenSslType; // manually call into ffi to avoid forcing the features unsafe { cvt_p(ffi::DH_get_2048_256()).map(|p| Dh::from_ptr(p)) } unsafe { cvt_p(ffi::DH_get_2048_256()).map(|p| Dh::from_ptr(p)) } } #[cfg(ossl101)] Loading Loading @@ -302,8 +300,7 @@ mod verify { } } fn verify_subject_alt_names(domain: &str, names: Stack<GeneralName>) -> bool { fn verify_subject_alt_names(domain: &str, names: Stack<GeneralName>) -> bool { let ip = domain.parse(); for name in &names { Loading
openssl/src/stack.rs +7 −10 Original line number Diff line number Diff line Loading @@ -226,7 +226,8 @@ impl<'a, T: Stackable> iter::IntoIterator for &'a mut Stack<T> { /// An iterator over the stack's contents. pub struct Iter<'a, T: Stackable> where T: 'a { where T: 'a { stack: &'a StackRef<T>, pos: usize, } Loading @@ -251,8 +252,7 @@ impl<'a, T: Stackable> iter::Iterator for Iter<'a, T> { } } impl<'a, T: Stackable> iter::ExactSizeIterator for Iter<'a, T> { } impl<'a, T: Stackable> iter::ExactSizeIterator for Iter<'a, T> {} /// A mutable iterator over the stack's contents. pub struct IterMut<'a, T: Stackable + 'a> { Loading @@ -272,9 +272,7 @@ impl<'a, T: Stackable> iter::Iterator for IterMut<'a, T> { // guarantee that we won't return several references to // the same object, so we have to use unsafe code for // mutable iterators. let n = unsafe { Some(T::Ref::from_ptr_mut(self.stack._get(self.pos))) }; let n = unsafe { Some(T::Ref::from_ptr_mut(self.stack._get(self.pos))) }; self.pos += 1; Loading @@ -289,5 +287,4 @@ impl<'a, T: Stackable> iter::Iterator for IterMut<'a, T> { } } impl<'a, T: Stackable> iter::ExactSizeIterator for IterMut<'a, T> { } impl<'a, T: Stackable> iter::ExactSizeIterator for IterMut<'a, T> {}
openssl/src/x509/mod.rs +2 −3 Original line number Diff line number Diff line Loading @@ -513,9 +513,8 @@ impl<'a> Iterator for X509NameEntries<'a> { fn next(&mut self) -> Option<&'a X509NameEntryRef> { unsafe { self.loc = ffi::X509_NAME_get_index_by_NID(self.name.as_ptr(), self.nid.as_raw(), self.loc); self.loc = ffi::X509_NAME_get_index_by_NID(self.name.as_ptr(), self.nid.as_raw(), self.loc); if self.loc == -1 { return None; Loading