diff options
| author | Gleb Kozyrev <[email protected]> | 2015-01-22 18:03:19 +0200 |
|---|---|---|
| committer | Gleb Kozyrev <[email protected]> | 2015-01-28 21:51:12 +0200 |
| commit | 71f84202053e81581dc619ae9df1c37cfc0482e6 (patch) | |
| tree | faf581a7f8739ae16af648c1caf386e0085672c6 /src/crypto/pkey.rs | |
| parent | Change Hasher and HMAC APIs closer to std::hash model (diff) | |
| download | rust-openssl-71f84202053e81581dc619ae9df1c37cfc0482e6.tar.xz rust-openssl-71f84202053e81581dc619ae9df1c37cfc0482e6.zip | |
Rename crypto::hash::HashType -> Type
s/HashType/Type/ to follow the current Rust style. Import Type as HashType in modules where the name might be ambiguous.
[breaking change]
Diffstat (limited to 'src/crypto/pkey.rs')
| -rw-r--r-- | src/crypto/pkey.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/crypto/pkey.rs b/src/crypto/pkey.rs index 1aa5cc0e..c20fae4f 100644 --- a/src/crypto/pkey.rs +++ b/src/crypto/pkey.rs @@ -3,7 +3,8 @@ use std::iter::repeat; use std::mem; use std::ptr; use bio::{MemBio}; -use crypto::hash::HashType; +use crypto::hash; +use crypto::hash::Type as HashType; use ffi; use ssl::error::{SslError, StreamError}; @@ -276,7 +277,7 @@ impl PKey { */ pub fn verify(&self, m: &[u8], s: &[u8]) -> bool { self.verify_with_hash(m, s, HashType::SHA256) } - pub fn sign_with_hash(&self, s: &[u8], hash: HashType) -> Vec<u8> { + pub fn sign_with_hash(&self, s: &[u8], hash: hash::Type) -> Vec<u8> { unsafe { let rsa = ffi::EVP_PKEY_get1_RSA(self.evp); let len = ffi::RSA_size(rsa); @@ -300,7 +301,7 @@ impl PKey { } } - pub fn verify_with_hash(&self, m: &[u8], s: &[u8], hash: HashType) -> bool { + pub fn verify_with_hash(&self, m: &[u8], s: &[u8], hash: hash::Type) -> bool { unsafe { let rsa = ffi::EVP_PKEY_get1_RSA(self.evp); @@ -332,7 +333,7 @@ impl Drop for PKey { #[cfg(test)] mod tests { - use crypto::hash::HashType::{MD5, SHA1}; + use crypto::hash::Type::{MD5, SHA1}; #[test] fn test_gen_pub() { |