diff options
author | Steven Fackler <sfackler@gmail.com> | 2020-11-29 11:59:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-29 11:59:07 -0500 |
commit | 75b0978bc840cb668b2c2a9383aa5562049a6698 (patch) | |
tree | 17c8d6ba389f628a3b0e8f57cf6f432ade8f1440 /openssl/src/ec.rs | |
parent | 8341d79cd3c32b9518b2d932f7b69b135fd8e697 (diff) | |
parent | b2caf477fdaa68887d9343e6d119d9312f40204c (diff) | |
download | rust-openssl-75b0978bc840cb668b2c2a9383aa5562049a6698.zip |
Merge pull request #1345 from stbuehler/from-const-ptr
Add and use ForeignTypeRefExt::from_const_ptr
Diffstat (limited to 'openssl/src/ec.rs')
-rw-r--r-- | openssl/src/ec.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openssl/src/ec.rs b/openssl/src/ec.rs index 23d4015d..379b3647 100644 --- a/openssl/src/ec.rs +++ b/openssl/src/ec.rs @@ -25,6 +25,7 @@ use bn::{BigNumContextRef, BigNumRef}; use error::ErrorStack; use nid::Nid; use pkey::{HasParams, HasPrivate, HasPublic, Params, Private, Public}; +use util::ForeignTypeRefExt; use {cvt, cvt_n, cvt_p, init}; /// Compressed or Uncompressed conversion @@ -230,7 +231,7 @@ impl EcGroupRef { pub fn generator(&self) -> &EcPointRef { unsafe { let ptr = ffi::EC_GROUP_get0_generator(self.as_ptr()); - EcPointRef::from_ptr(ptr as *mut _) + EcPointRef::from_const_ptr(ptr) } } @@ -622,7 +623,7 @@ where pub fn private_key(&self) -> &BigNumRef { unsafe { let ptr = ffi::EC_KEY_get0_private_key(self.as_ptr()); - BigNumRef::from_ptr(ptr as *mut _) + BigNumRef::from_const_ptr(ptr) } } } @@ -639,7 +640,7 @@ where pub fn public_key(&self) -> &EcPointRef { unsafe { let ptr = ffi::EC_KEY_get0_public_key(self.as_ptr()); - EcPointRef::from_ptr(ptr as *mut _) + EcPointRef::from_const_ptr(ptr) } } @@ -678,7 +679,7 @@ where pub fn group(&self) -> &EcGroupRef { unsafe { let ptr = ffi::EC_KEY_get0_group(self.as_ptr()); - EcGroupRef::from_ptr(ptr as *mut _) + EcGroupRef::from_const_ptr(ptr) } } |