From ad2517f797b47e86600237bc270b216b716c1d8f Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 15 May 2023 15:35:55 +0200 Subject: [PATCH 1/2] Fix build --- boring/src/x509/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boring/src/x509/mod.rs b/boring/src/x509/mod.rs index 47d7c9c3..a3b3a044 100644 --- a/boring/src/x509/mod.rs +++ b/boring/src/x509/mod.rs @@ -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, )) From 6e751e85cb771cbcd1fb94d843aaa6658d04484b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 15 May 2023 15:26:16 +0200 Subject: [PATCH 2/2] Revert "Merge pull request #108 from nox/store-clone" This reverts commit 1c1af4b38b65aaed08efe1db45b40abd0bf9ed78, reversing changes made to da32be1fa9d6c45a1a1b16bfeffe27bfa9344b28. SslContextBuilder::cert_store_mut returns a &mut X509StoreBuilder backed by a X509Store that is already shared with an existing SslContext. --- boring/src/x509/store.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/boring/src/x509/store.rs b/boring/src/x509/store.rs index 53149e3e..7033450a 100644 --- a/boring/src/x509/store.rs +++ b/boring/src/x509/store.rs @@ -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;