diff options
| author | Steven Fackler <[email protected]> | 2016-01-22 15:57:24 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-01-22 15:57:24 -0800 |
| commit | 1417ebdd6efdad271026152da63eb0f442fb1c5e (patch) | |
| tree | 7b480e4ddd427ee67cc912452c78fb087808eace /openssl/src/x509/mod.rs | |
| parent | Merge branch 'release-v0.7.4' into release (diff) | |
| parent | Release v0.7.5 (diff) | |
| download | rust-openssl-0.7.5.tar.xz rust-openssl-0.7.5.zip | |
Merge branch 'release-v0.7.5' into releasev0.7.5
Diffstat (limited to 'openssl/src/x509/mod.rs')
| -rw-r--r-- | openssl/src/x509/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index ffd478ef..f31de89b 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -507,6 +507,20 @@ 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 { |