From 2251a6f2b6da97a2e07f230787cb63c549e6940c Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Tue, 21 Mar 2017 08:59:56 +0000 Subject: [PATCH] Little tweaks --- openssl/src/x509/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index 52907110..dcd4296a 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -88,14 +88,14 @@ impl X509StoreContextRef { /// Initializes the store context to verify the certificate. /// - /// This Context can only be used once, subsequent to any validation, the context must be reinitialized. + /// The context must be re-initialized before each call to `verify_cert`. /// /// # Arguments /// /// * `trust` - a store of the trusted chain of certificates, or CAs, to validated the certificate /// * `cert` - certificate to validate - /// * `cert_chain` - the certificates chain - pub fn init(&self, trust: &store::X509StoreRef, cert: &X509Ref, cert_chain: &StackRef) -> Result<(), ErrorStack> { + /// * `cert_chain` - the certificate's chain + pub fn init(&mut self, trust: &store::X509StoreRef, cert: &X509Ref, cert_chain: &StackRef) -> Result<(), ErrorStack> { unsafe { cvt(ffi::X509_STORE_CTX_init(self.as_ptr(), trust.as_ptr(), cert.as_ptr(), cert_chain.as_ptr())) .map(|_| ()) @@ -113,7 +113,7 @@ impl X509StoreContextRef { /// Verifies the certificate associated in the `init()` method /// - /// This consumes self as the `X509StoreContext` must be reinitialized subsequent to any cally to verify. + /// The context must be re-initialized before each call to this method. pub fn verify_cert(&self) -> Result, ErrorStack> { unsafe { try!(cvt(ffi::X509_verify_cert(self.as_ptr())).map(|_| ()))