Merge pull request #120 from nox/revert

Revert "Merge pull request #108 from nox/store-clone"
This commit is contained in:
Ivan Nikulin 2023-07-03 11:09:41 +01:00 committed by GitHub
commit 8f488550eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 21 deletions

View File

@ -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,
))
@ -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,
))

View File

@ -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;