aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-08-08 20:37:48 -0700
committerSteven Fackler <[email protected]>2016-08-08 20:37:48 -0700
commit522447378e058b60822f5caa752506924a226872 (patch)
tree57089af829c5046225045e70924ec29f0bd7e0c1 /openssl/src
parentRemove symm_internal (diff)
downloadrust-openssl-522447378e058b60822f5caa752506924a226872.tar.xz
rust-openssl-522447378e058b60822f5caa752506924a226872.zip
Copy over getter macros
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/crypto/pkcs5.rs6
-rw-r--r--openssl/src/crypto/symm.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/openssl/src/crypto/pkcs5.rs b/openssl/src/crypto/pkcs5.rs
index 0098de8c..ef84fbe1 100644
--- a/openssl/src/crypto/pkcs5.rs
+++ b/openssl/src/crypto/pkcs5.rs
@@ -17,11 +17,11 @@ pub struct KeyIvPair {
///
/// If specified `salt` must be 8 bytes in length.
///
-/// If the total key and IV length is less than 16 bytes and MD5 is used then
-/// the algorithm is compatible with the key derivation algorithm from PKCS#5
+/// If the total key and IV length is less than 16 bytes and MD5 is used then
+/// the algorithm is compatible with the key derivation algorithm from PKCS#5
/// v1.5 or PBKDF1 from PKCS#5 v2.0.
///
-/// New applications should not use this and instead use `pbkdf2_hmac_sha1` or
+/// New applications should not use this and instead use `pbkdf2_hmac_sha1` or
/// another more modern key derivation algorithm.
pub fn evp_bytes_to_key_pbkdf1_compatible(typ: symm::Type,
message_digest_type: hash::Type,
diff --git a/openssl/src/crypto/symm.rs b/openssl/src/crypto/symm.rs
index b9fc5933..84bbbb8d 100644
--- a/openssl/src/crypto/symm.rs
+++ b/openssl/src/crypto/symm.rs
@@ -79,7 +79,7 @@ impl Type {
/// Returns the length of keys used with this cipher.
pub fn key_len(&self) -> usize {
unsafe {
- (*self.as_ptr()).key_len as usize
+ ffi::EVP_CIPHER_key_length(self.as_ptr()) as usize
}
}
@@ -87,7 +87,7 @@ impl Type {
/// cipher does not use an IV.
pub fn iv_len(&self) -> Option<usize> {
unsafe {
- let len = (*self.as_ptr()).iv_len as usize;
+ let len = ffi::EVP_CIPHER_iv_length(self.as_ptr()) as usize;
if len == 0 {
None
} else {
@@ -103,7 +103,7 @@ impl Type {
/// Stream ciphers such as RC4 have a block size of 1.
pub fn block_size(&self) -> usize {
unsafe {
- (*self.as_ptr()).block_size as usize
+ ffi::EVP_CIPHER_block_size(self.as_ptr()) as usize
}
}
}