Loading openssl/src/c_helpers.c +4 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,7 @@ void rust_SSL_clone(SSL *ssl) { void rust_SSL_CTX_clone(SSL_CTX *ctx) { CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX); } void rust_EVP_PKEY_clone(EVP_PKEY *pkey) { CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); } openssl/src/crypto/pkey.rs +14 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,10 @@ fn openssl_hash_nid(hash: HashType) -> c_int { } } extern "C" { fn rust_EVP_PKEY_clone(pkey: *mut ffi::EVP_PKEY); } pub struct PKey { evp: *mut ffi::EVP_PKEY, parts: Parts, Loading Loading @@ -600,6 +604,16 @@ impl Drop for PKey { } } impl Clone for PKey { fn clone(&self) -> Self { unsafe { rust_EVP_PKEY_clone(self.evp); } PKey::from_handle(self.evp, self.parts) } } #[cfg(test)] mod tests { use std::path::Path; Loading Loading
openssl/src/c_helpers.c +4 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,7 @@ void rust_SSL_clone(SSL *ssl) { void rust_SSL_CTX_clone(SSL_CTX *ctx) { CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX); } void rust_EVP_PKEY_clone(EVP_PKEY *pkey) { CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); }
openssl/src/crypto/pkey.rs +14 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,10 @@ fn openssl_hash_nid(hash: HashType) -> c_int { } } extern "C" { fn rust_EVP_PKEY_clone(pkey: *mut ffi::EVP_PKEY); } pub struct PKey { evp: *mut ffi::EVP_PKEY, parts: Parts, Loading Loading @@ -600,6 +604,16 @@ impl Drop for PKey { } } impl Clone for PKey { fn clone(&self) -> Self { unsafe { rust_EVP_PKEY_clone(self.evp); } PKey::from_handle(self.evp, self.parts) } } #[cfg(test)] mod tests { use std::path::Path; Loading