diff options
| author | Steven Fackler <[email protected]> | 2014-05-09 22:08:29 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2014-05-09 22:08:29 -0700 |
| commit | 656d64916a73323511a989fe8423d3d153f9c03a (patch) | |
| tree | 04b690b9ac339d1c18ca7dcd3ec830419898f131 | |
| parent | Update for upstream changes (diff) | |
| download | rust-openssl-656d64916a73323511a989fe8423d3d153f9c03a.tar.xz rust-openssl-656d64916a73323511a989fe8423d3d153f9c03a.zip | |
Fix tests for upstream changes
| -rw-r--r-- | crypto/hash.rs | 4 | ||||
| -rw-r--r-- | crypto/symm.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crypto/hash.rs b/crypto/hash.rs index 57b9fdbf..e3182b1b 100644 --- a/crypto/hash.rs +++ b/crypto/hash.rs @@ -107,7 +107,7 @@ mod tests { use serialize::hex::{FromHex, ToHex}; struct HashTest { - input: ~[u8], + input: Vec<u8>, expected_output: ~str } @@ -117,7 +117,7 @@ mod tests { } fn hash_test(hashtype: super::HashType, hashtest: &HashTest) { - let calced_raw = super::hash(hashtype, hashtest.input); + let calced_raw = super::hash(hashtype, hashtest.input.as_slice()); let calced = calced_raw.as_slice().to_hex(); diff --git a/crypto/symm.rs b/crypto/symm.rs index 24992153..00846380 100644 --- a/crypto/symm.rs +++ b/crypto/symm.rs @@ -225,10 +225,10 @@ mod tests { use serialize::hex::ToHex; let cipher = super::Crypter::new(ciphertype); - cipher.init(super::Encrypt, key.from_hex().unwrap(), iv.from_hex().unwrap()); + cipher.init(super::Encrypt, key.from_hex().unwrap().as_slice(), iv.from_hex().unwrap().as_slice()); - let expected = Vec::from_slice(ct.from_hex().unwrap()); - let computed = cipher.update(pt.from_hex().unwrap()).append(cipher.final().as_slice()); + let expected = Vec::from_slice(ct.from_hex().unwrap().as_slice()); + let computed = cipher.update(pt.from_hex().unwrap().as_slice()).append(cipher.final().as_slice()); if computed != expected { println!("Computed: {}", computed.as_slice().to_hex()); |