Add X509VerifyParamRef::copy_from (#361)

This commit is contained in:
Anthony Ramine 2025-06-02 16:39:11 +02:00 committed by GitHub
parent 2bc82e8d1c
commit 7a52fbbe99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -182,4 +182,12 @@ impl X509VerifyParamRef {
pub fn set_depth(&mut self, depth: c_int) {
unsafe { ffi::X509_VERIFY_PARAM_set_depth(self.as_ptr(), depth) }
}
/// Copies parameters from `src`.
///
/// If a parameter is unset in `src`, the existing value in `self`` is preserved.
#[corresponds(X509_VERIFY_PARAM_set1)]
pub fn copy_from(&mut self, src: &Self) -> Result<(), ErrorStack> {
unsafe { cvt(ffi::X509_VERIFY_PARAM_set1(self.as_ptr(), src.as_ptr())).map(|_| ()) }
}
}