aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/crypto/pkcs5.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-10-14 11:39:43 -0700
committerGitHub <[email protected]>2016-10-14 11:39:43 -0700
commit98e71596fb48ce7cdabd46e581f32a9a54398cce (patch)
tree7d600055248d58edfccd4ed5577c32c86bac3ff2 /openssl/src/crypto/pkcs5.rs
parentRename NoPadding to None (diff)
parentIgnore DTLS tests on Windows/ARM for now (diff)
downloadrust-openssl-98e71596fb48ce7cdabd46e581f32a9a54398cce.tar.xz
rust-openssl-98e71596fb48ce7cdabd46e581f32a9a54398cce.zip
Merge pull request #464 from alexcrichton/systest
Add support for OpenSSL 1.1.0
Diffstat (limited to 'openssl/src/crypto/pkcs5.rs')
-rw-r--r--openssl/src/crypto/pkcs5.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/openssl/src/crypto/pkcs5.rs b/openssl/src/crypto/pkcs5.rs
index ef84fbe1..adcbc9db 100644
--- a/openssl/src/crypto/pkcs5.rs
+++ b/openssl/src/crypto/pkcs5.rs
@@ -82,7 +82,7 @@ pub fn pbkdf2_hmac_sha1(pass: &[u8],
ffi::init();
- try_ssl!(ffi::PKCS5_PBKDF2_HMAC_SHA1(pass.as_ptr(),
+ try_ssl!(ffi::PKCS5_PBKDF2_HMAC_SHA1(pass.as_ptr() as *const _,
pass.len() as c_int,
salt.as_ptr(),
salt.len() as c_int,
@@ -94,7 +94,6 @@ pub fn pbkdf2_hmac_sha1(pass: &[u8],
}
/// Derives a key from a password and salt using the PBKDF2-HMAC algorithm with a digest function.
-#[cfg(feature = "pkcs5_pbkdf2_hmac")]
pub fn pbkdf2_hmac(pass: &[u8],
salt: &[u8],
iter: usize,
@@ -104,7 +103,7 @@ pub fn pbkdf2_hmac(pass: &[u8],
unsafe {
let mut out = vec![0; keylen];
ffi::init();
- try_ssl!(ffi::PKCS5_PBKDF2_HMAC(pass.as_ptr(),
+ try_ssl!(ffi::PKCS5_PBKDF2_HMAC(pass.as_ptr() as *const _,
pass.len() as c_int,
salt.as_ptr(),
salt.len() as c_int,
@@ -162,7 +161,6 @@ mod tests {
// Test vectors from
// https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.1.1_release_20150424/testsuite/pbkdf2-test.c
#[test]
- #[cfg(feature = "pkcs5_pbkdf2_hmac")]
fn test_pbkdf2_hmac_sha256() {
assert_eq!(super::pbkdf2_hmac(b"passwd", b"salt", 1, hash::Type::SHA256, 16).unwrap(),
vec![0x55_u8, 0xac_u8, 0x04_u8, 0x6e_u8, 0x56_u8, 0xe3_u8, 0x08_u8, 0x9f_u8,
@@ -176,7 +174,6 @@ mod tests {
// Test vectors from
// https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.1.1_release_20150424/testsuite/pbkdf2-test.c
#[test]
- #[cfg(feature = "pkcs5_pbkdf2_hmac")]
fn test_pbkdf2_hmac_sha512() {
assert_eq!(super::pbkdf2_hmac(b"password", b"NaCL", 1, hash::Type::SHA512, 64).unwrap(),
vec![0x73_u8, 0xde_u8, 0xcf_u8, 0xa5_u8, 0x8a_u8, 0xa2_u8, 0xe8_u8, 0x4f_u8,