aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-01-28 23:37:45 -0800
committerSteven Fackler <[email protected]>2016-01-28 23:37:45 -0800
commitb2e18c1d760774ed6b3b9928cdb4074dfbfd4f92 (patch)
tree2606f7db790ea7531fc098ca4e51423f8e4d488c
parentMerge pull request #343 from jimmycuadra/ordered-extensions (diff)
parentRevert "impl Clone for PKey and X509 by using their 'references' member" (diff)
downloadrust-openssl-b2e18c1d760774ed6b3b9928cdb4074dfbfd4f92.tar.xz
rust-openssl-b2e18c1d760774ed6b3b9928cdb4074dfbfd4f92.zip
Merge pull request #344 from sfackler/revert-336-x509-pky-clone
Revert "impl Clone for PKey and X509 by using their 'references' member"
-rw-r--r--openssl/src/c_helpers.c8
-rw-r--r--openssl/src/crypto/pkey.rs14
-rw-r--r--openssl/src/x509/mod.rs14
3 files changed, 0 insertions, 36 deletions
diff --git a/openssl/src/c_helpers.c b/openssl/src/c_helpers.c
index 1b48565e..402c36ec 100644
--- a/openssl/src/c_helpers.c
+++ b/openssl/src/c_helpers.c
@@ -7,11 +7,3 @@ 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);
-}
-
-void rust_X509_clone(X509 *x509) {
- CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
-}
diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs
index dee6cb8b..314ee63d 100644
--- a/openssl/src/crypto/pkey.rs
+++ b/openssl/src/crypto/pkey.rs
@@ -52,10 +52,6 @@ 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,
@@ -604,16 +600,6 @@ 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;
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index a69f61d5..8cc34cad 100644
--- a/openssl/src/x509/mod.rs
+++ b/openssl/src/x509/mod.rs
@@ -509,20 +509,6 @@ impl<'ctx> X509<'ctx> {
}
}
-extern "C" {
- fn rust_X509_clone(x509: *mut ffi::X509);
-}
-
-impl<'ctx> Clone for X509<'ctx> {
- fn clone(&self) -> X509<'ctx> {
- unsafe { rust_X509_clone(self.handle) }
- /* FIXME: given that we now have refcounting control, 'owned' should be uneeded, the 'ctx
- * is probably also uneeded. We can remove both to condense the x509 api quite a bit
- */
- X509::new(self.handle, true)
- }
-}
-
impl<'ctx> Drop for X509<'ctx> {
fn drop(&mut self) {
if self.owned {