Skip to content

Commit

Permalink
Merge pull request #120 from nox/revert
Browse files Browse the repository at this point in the history
Revert "Merge pull request #108 from nox/store-clone"
  • Loading branch information
inikulin authored Jul 3, 2023
2 parents 1c1af4b + 6e751e8 commit 8f48855
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
8 changes: 4 additions & 4 deletions boring/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,13 +896,13 @@ impl X509NameBuilder {
) -> Result<(), ErrorStack> {
unsafe {
let field = CString::new(field).unwrap();
assert!(value.len() <= c_int::max_value() as usize);
assert!(value.len() <= ValueLen::max_value() as usize);
cvt(ffi::X509_NAME_add_entry_by_txt(
self.0.as_ptr(),
field.as_ptr() as *mut _,
ty.as_raw(),
value.as_ptr(),
value.len() as c_int,
value.len() as ValueLen,
-1,
0,
))
Expand Down Expand Up @@ -943,13 +943,13 @@ impl X509NameBuilder {
ty: Asn1Type,
) -> Result<(), ErrorStack> {
unsafe {
assert!(value.len() <= c_int::max_value() as usize);
assert!(value.len() <= ValueLen::max_value() as usize);
cvt(ffi::X509_NAME_add_entry_by_NID(
self.0.as_ptr(),
field.as_raw(),
ty.as_raw(),
value.as_ptr() as *mut _,
value.len() as c_int,
value.len() as ValueLen,
-1,
0,
))
Expand Down
17 changes: 0 additions & 17 deletions boring/src/x509/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,4 @@ impl X509StoreRef {
}
}

impl ToOwned for X509StoreRef {
type Owned = X509Store;

fn to_owned(&self) -> X509Store {
unsafe {
ffi::X509_STORE_up_ref(self.as_ptr());
X509Store::from_ptr(self.as_ptr())
}
}
}

impl Clone for X509Store {
fn clone(&self) -> Self {
(**self).to_owned()
}
}

use crate::ffi::X509_STORE_get0_objects;

0 comments on commit 8f48855

Please sign in to comment.