diff options
| author | Chris Cole <[email protected]> | 2014-12-23 15:14:27 -0500 |
|---|---|---|
| committer | Chris Cole <[email protected]> | 2014-12-23 15:14:27 -0500 |
| commit | 156fc65eb0138da8c603df82baa4a756d4d6d420 (patch) | |
| tree | 9bf3be6761bfbc3c2d27454f429965f9e8790e08 /src/crypto | |
| parent | Added BigNum::{from_dec_str,from_hex_str}, BN_dec2bn, and BN_hex2bn. (diff) | |
| parent | Release v0.2.8 (diff) | |
| download | rust-openssl-156fc65eb0138da8c603df82baa4a756d4d6d420.tar.xz rust-openssl-156fc65eb0138da8c603df82baa4a756d4d6d420.zip | |
Merge remote-tracking branch 'upstream/master'
Conflicts:
openssl-sys/src/lib.rs
Diffstat (limited to 'src/crypto')
| -rw-r--r-- | src/crypto/hash.rs | 3 | ||||
| -rw-r--r-- | src/crypto/hmac.rs | 2 | ||||
| -rw-r--r-- | src/crypto/pkey.rs | 4 | ||||
| -rw-r--r-- | src/crypto/symm.rs | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/crypto/hash.rs b/src/crypto/hash.rs index b5d0eab5..2a181526 100644 --- a/src/crypto/hash.rs +++ b/src/crypto/hash.rs @@ -4,6 +4,7 @@ use std::io; use ffi; +#[deriving(Copy)] pub enum HashType { MD5, SHA1, @@ -134,7 +135,7 @@ mod tests { } fn compare(calced_raw: Vec<u8>, hashtest: &HashTest) { - let calced = calced_raw.as_slice().to_hex().into_string(); + let calced = calced_raw.as_slice().to_hex().to_string(); if calced != hashtest.expected_output { println!("Test failed - {} != {}", calced, hashtest.expected_output); diff --git a/src/crypto/hmac.rs b/src/crypto/hmac.rs index 8096a948..aab0c014 100644 --- a/src/crypto/hmac.rs +++ b/src/crypto/hmac.rs @@ -55,7 +55,7 @@ impl HMAC { let mut res = Vec::from_elem(self.len, 0u8); let mut outlen = 0; ffi::HMAC_Final(&mut self.ctx, res.as_mut_ptr(), &mut outlen); - assert!(self.len == outlen as uint) + assert!(self.len == outlen as uint); res } } diff --git a/src/crypto/pkey.rs b/src/crypto/pkey.rs index 146d2aa3..bab7addc 100644 --- a/src/crypto/pkey.rs +++ b/src/crypto/pkey.rs @@ -6,7 +6,7 @@ use crypto::hash::HashType; use ffi; use ssl::error::{SslError, StreamError}; - +#[deriving(Copy)] enum Parts { Neither, Public, @@ -14,6 +14,7 @@ enum Parts { } /// Represents a role an asymmetric key might be appropriate for. +#[deriving(Copy)] pub enum Role { Encrypt, Decrypt, @@ -22,6 +23,7 @@ pub enum Role { } /// Type of encryption padding to use. +#[deriving(Copy)] pub enum EncryptionPadding { OAEP, PKCS1v15 diff --git a/src/crypto/symm.rs b/src/crypto/symm.rs index 998d351c..61365f2e 100644 --- a/src/crypto/symm.rs +++ b/src/crypto/symm.rs @@ -2,12 +2,14 @@ use libc::{c_int}; use ffi; +#[deriving(Copy)] pub enum Mode { Encrypt, Decrypt, } #[allow(non_camel_case_types)] +#[deriving(Copy)] pub enum Type { AES_128_ECB, AES_128_CBC, |