diff options
| author | Brian Chin <[email protected]> | 2017-01-31 11:59:59 -0800 |
|---|---|---|
| committer | Brian Chin <[email protected]> | 2017-01-31 11:59:59 -0800 |
| commit | 4900d3fe5d8fe9f581940bd60e2d919155839fa8 (patch) | |
| tree | a6614602603c645617e15286f9fc92385e651735 /openssl/src | |
| parent | Adding suggestions from review. (diff) | |
| download | rust-openssl-4900d3fe5d8fe9f581940bd60e2d919155839fa8.tar.xz rust-openssl-4900d3fe5d8fe9f581940bd60e2d919155839fa8.zip | |
Fixed constant names from openssl/rsa.h
Fixed PKeyCtxRef method that didn't need to be mutable.
Added non-mutable accessors for PKeyCtxRef for Signer and Verifier.
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/pkey.rs | 2 | ||||
| -rw-r--r-- | openssl/src/sign.rs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/openssl/src/pkey.rs b/openssl/src/pkey.rs index 0d8de1dd..c9f5ec1b 100644 --- a/openssl/src/pkey.rs +++ b/openssl/src/pkey.rs @@ -161,7 +161,7 @@ impl PKeyCtxRef { Ok(()) } - pub fn rsa_padding(&mut self) -> Result<Padding, ErrorStack> { + pub fn rsa_padding(&self) -> Result<Padding, ErrorStack> { let mut pad: c_int = 0; unsafe { try!(cvt(ffi::EVP_PKEY_CTX_get_rsa_padding(self.as_ptr(), &mut pad))); diff --git a/openssl/src/sign.rs b/openssl/src/sign.rs index 3ae8f1a2..ac33bd07 100644 --- a/openssl/src/sign.rs +++ b/openssl/src/sign.rs @@ -119,6 +119,10 @@ impl<'a> Signer<'a> { } } + pub fn pkey_ctx(&self) -> &PKeyCtxRef { + unsafe { ::types::OpenSslTypeRef::from_ptr(self.pkey_ctx) } + } + pub fn pkey_ctx_mut(&mut self) -> &mut PKeyCtxRef { unsafe { ::types::OpenSslTypeRef::from_ptr_mut(self.pkey_ctx) } } @@ -195,6 +199,10 @@ impl<'a> Verifier<'a> { } } + pub fn pkey_ctx(&self) -> &PKeyCtxRef { + unsafe { ::types::OpenSslTypeRef::from_ptr(self.pkey_ctx) } + } + pub fn pkey_ctx_mut(&mut self) -> &mut PKeyCtxRef { unsafe { ::types::OpenSslTypeRef::from_ptr_mut(self.pkey_ctx) } } |