Loading openssl-sys/src/handwritten/x509_vfy.rs +6 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,12 @@ extern "C" { #[cfg(any(ossl102, libressl261))] pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint); #[cfg(any(ossl102, libressl261))] pub fn X509_VERIFY_PARAM_set1_email( param: *mut X509_VERIFY_PARAM, email: *const c_char, emaillen: size_t, ) -> c_int; #[cfg(any(ossl102, libressl261))] pub fn X509_VERIFY_PARAM_set1_ip( param: *mut X509_VERIFY_PARAM, ip: *const c_uchar, Loading openssl/CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ ## [Unreleased] ### Added * Added `X509VerifyParam::set_email` ## [v0.10.56] - 2023-08-06 ## Added Loading openssl/src/x509/verify.rs +15 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,21 @@ impl X509VerifyParamRef { } } /// Set the expected email address. #[corresponds(X509_VERIFY_PARAM_set1_email)] pub fn set_email(&mut self, email: &str) -> Result<(), ErrorStack> { unsafe { // len == 0 means "run strlen" :( let raw_email = if email.is_empty() { "\0" } else { email }; cvt(ffi::X509_VERIFY_PARAM_set1_email( self.as_ptr(), raw_email.as_ptr() as *const _, email.len(), )) .map(|_| ()) } } /// Set the expected IPv4 or IPv6 address. #[corresponds(X509_VERIFY_PARAM_set1_ip)] pub fn set_ip(&mut self, ip: IpAddr) -> Result<(), ErrorStack> { Loading Loading
openssl-sys/src/handwritten/x509_vfy.rs +6 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,12 @@ extern "C" { #[cfg(any(ossl102, libressl261))] pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint); #[cfg(any(ossl102, libressl261))] pub fn X509_VERIFY_PARAM_set1_email( param: *mut X509_VERIFY_PARAM, email: *const c_char, emaillen: size_t, ) -> c_int; #[cfg(any(ossl102, libressl261))] pub fn X509_VERIFY_PARAM_set1_ip( param: *mut X509_VERIFY_PARAM, ip: *const c_uchar, Loading
openssl/CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ ## [Unreleased] ### Added * Added `X509VerifyParam::set_email` ## [v0.10.56] - 2023-08-06 ## Added Loading
openssl/src/x509/verify.rs +15 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,21 @@ impl X509VerifyParamRef { } } /// Set the expected email address. #[corresponds(X509_VERIFY_PARAM_set1_email)] pub fn set_email(&mut self, email: &str) -> Result<(), ErrorStack> { unsafe { // len == 0 means "run strlen" :( let raw_email = if email.is_empty() { "\0" } else { email }; cvt(ffi::X509_VERIFY_PARAM_set1_email( self.as_ptr(), raw_email.as_ptr() as *const _, email.len(), )) .map(|_| ()) } } /// Set the expected IPv4 or IPv6 address. #[corresponds(X509_VERIFY_PARAM_set1_ip)] pub fn set_ip(&mut self, ip: IpAddr) -> Result<(), ErrorStack> { Loading