aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/pkey.rs
diff options
context:
space:
mode:
authorJeremy Ruten <[email protected]>2014-08-04 15:20:49 -0600
committerJeremy Ruten <[email protected]>2014-08-04 15:20:49 -0600
commit9f2a9c852404f5a8fd212a0499b1cc5df955bcb9 (patch)
tree4064793833ab234da1f464a02883c265a89135f1 /src/crypto/pkey.rs
parentFix doc build (diff)
downloadrust-openssl-9f2a9c852404f5a8fd212a0499b1cc5df955bcb9.tar.xz
rust-openssl-9f2a9c852404f5a8fd212a0499b1cc5df955bcb9.zip
Add new HashType RIPEMD160
Diffstat (limited to 'src/crypto/pkey.rs')
-rw-r--r--src/crypto/pkey.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/crypto/pkey.rs b/src/crypto/pkey.rs
index 5f617fa7..c41f2a0c 100644
--- a/src/crypto/pkey.rs
+++ b/src/crypto/pkey.rs
@@ -2,7 +2,7 @@ use libc::{c_char, c_int, c_uint};
use libc;
use std::mem;
use std::ptr;
-use crypto::hash::{HashType, MD5, SHA1, SHA224, SHA256, SHA384, SHA512};
+use crypto::hash::{HashType, MD5, SHA1, SHA224, SHA256, SHA384, SHA512, RIPEMD160};
#[allow(non_camel_case_types)]
pub type EVP_PKEY = *mut libc::c_void;
@@ -64,12 +64,13 @@ fn openssl_padding_code(padding: EncryptionPadding) -> c_int {
fn openssl_hash_nid(hash: HashType) -> c_int {
match hash {
- MD5 => 4, // NID_md5,
- SHA1 => 64, // NID_sha1
- SHA224 => 675, // NID_sha224
- SHA256 => 672, // NID_sha256
- SHA384 => 673, // NID_sha384
- SHA512 => 674, // NID_sha512
+ MD5 => 4, // NID_md5,
+ SHA1 => 64, // NID_sha1
+ SHA224 => 675, // NID_sha224
+ SHA256 => 672, // NID_sha256
+ SHA384 => 673, // NID_sha384
+ SHA512 => 674, // NID_sha512
+ RIPEMD160 => 117, // NID_ripemd160
}
}