parent
95f4b4e39e
commit
9da66c35d4
@ -1 +1,2 @@
|
||||
/crypto-hash-0.3.0.crate
|
||||
/crypto-hash-0.3.1.crate
|
||||
|
@ -1,64 +0,0 @@
|
||||
From d47183116ab10b53703c999eb0eccc85f6e1f89d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Lee <crypto-hash@lazymalevolence.com>
|
||||
Date: Sun, 26 Nov 2017 18:14:13 -0800
|
||||
Subject: [PATCH] Upgrade to hex 0.3
|
||||
|
||||
(cherry picked from commit 7036d94acc843e2a03d14d7c47de352a7be411cb)
|
||||
---
|
||||
src/lib.rs | 3 +--
|
||||
src/test.rs | 6 +++---
|
||||
2 files changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index 3e6f6cd..7bc8e30 100644
|
||||
--- a/src/lib.rs
|
||||
+++ b/src/lib.rs
|
||||
@@ -53,7 +53,6 @@ extern crate openssl;
|
||||
#[cfg(target_os = "windows")]
|
||||
extern crate winapi;
|
||||
|
||||
-use hex::ToHex;
|
||||
use std::io::Write;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -118,5 +117,5 @@ pub fn digest(algorithm: Algorithm, data: &[u8]) -> Vec<u8> {
|
||||
/// assert_eq!(expected, result)
|
||||
/// ```
|
||||
pub fn hex_digest(algorithm: Algorithm, data: &[u8]) -> String {
|
||||
- digest(algorithm, data).to_hex()
|
||||
+ hex::encode(digest(algorithm, data))
|
||||
}
|
||||
diff --git a/src/test.rs b/src/test.rs
|
||||
index 31920c4..2e1ef90 100644
|
||||
--- a/src/test.rs
|
||||
+++ b/src/test.rs
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
-use hex::ToHex;
|
||||
+use hex;
|
||||
use std::io::Write;
|
||||
use super::{Algorithm, Hasher, hex_digest};
|
||||
|
||||
@@ -59,7 +59,7 @@ fn sha512_empty_string() {
|
||||
#[test]
|
||||
fn hasher_sans_write() {
|
||||
let mut hasher = Hasher::new(Algorithm::MD5);
|
||||
- let actual = hasher.finish().to_hex();
|
||||
+ let actual = hex::encode(hasher.finish());
|
||||
assert_eq!(MD5_EMPTY_STRING, actual)
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ fn hasher_with_write() {
|
||||
hasher
|
||||
.write_all(TO_HASH.as_bytes())
|
||||
.expect("Could not write to hasher");
|
||||
- let actual = hasher.finish().to_hex();
|
||||
+ let actual = hex::encode(hasher.finish());
|
||||
assert_eq!(TO_HASH_MD5, actual)
|
||||
}
|
||||
|
||||
--
|
||||
2.15.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 962774effab9b47b52ae69bcafaa31006769452c Mon Sep 17 00:00:00 2001
|
||||
From: Alexandra Nikandrova <rage.iz.me@gmail.com>
|
||||
Date: Sat, 13 Jan 2018 18:28:48 +0100
|
||||
Subject: [PATCH] deps: update openssl to 0.10
|
||||
|
||||
Signed-off-by: Alexandra Nikandrova <rage.iz.me@gmail.com>
|
||||
---
|
||||
src/imp/openssl.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/imp/openssl.rs b/src/imp/openssl.rs
|
||||
index ba573c4..f786f62 100644
|
||||
--- a/src/imp/openssl.rs
|
||||
+++ b/src/imp/openssl.rs
|
||||
@@ -65,7 +65,7 @@ impl Hasher {
|
||||
/// Generate a digest from the data written to the `Hasher`.
|
||||
pub fn finish(&mut self) -> Vec<u8> {
|
||||
let Hasher(ref mut hasher) = *self;
|
||||
- match hasher.finish2() {
|
||||
+ match hasher.finish() {
|
||||
Ok(digest) => digest.to_vec(),
|
||||
Err(error_stack) => panic!("OpenSSL error(s): {}", error_stack),
|
||||
}
|
||||
--
|
||||
2.15.1
|
||||
|
@ -1,19 +0,0 @@
|
||||
--- crypto-hash-0.3.0/Cargo.toml 2017-06-18T22:54:02+02:00
|
||||
+++ crypto-hash-0.3.0/Cargo.toml 2018-01-14T23:37:00.761487+01:00
|
||||
@@ -18,14 +18,7 @@
|
||||
appveyor = { repository = "malept/crypto-hash" }
|
||||
|
||||
[dependencies]
|
||||
-hex = "0.2"
|
||||
-
|
||||
-[target.'cfg(target_os = "macos")'.dependencies]
|
||||
-commoncrypto = "0.2"
|
||||
-
|
||||
-[target.'cfg(target_os = "windows")'.dependencies]
|
||||
-advapi32-sys = "0.2"
|
||||
-winapi = "0.2"
|
||||
+hex = "0.3"
|
||||
|
||||
[target.'cfg(not(any(target_os = "windows", target_os = "macos")))'.dependencies]
|
||||
-openssl = "0.9"
|
||||
+openssl = "0.10"
|
@ -0,0 +1,14 @@
|
||||
--- crypto-hash-0.3.1/Cargo.toml 1969-12-31T16:00:00-08:00
|
||||
+++ crypto-hash-0.3.1/Cargo.toml 2018-03-05T16:12:58.730134-08:00
|
||||
@@ -25,11 +25,6 @@
|
||||
version = "0.3"
|
||||
[target."cfg(not(any(target_os = \"windows\", target_os = \"macos\")))".dependencies.openssl]
|
||||
version = "0.10"
|
||||
-[target."cfg(target_os = \"macos\")".dependencies.commoncrypto]
|
||||
-version = "0.2"
|
||||
-[target."cfg(target_os = \"windows\")".dependencies.winapi]
|
||||
-version = "0.3"
|
||||
-features = ["minwindef", "wincrypt"]
|
||||
[badges.appveyor]
|
||||
repository = "malept/crypto-hash"
|
||||
|
@ -1 +1 @@
|
||||
SHA512 (crypto-hash-0.3.0.crate) = 226755b61e7d75ff73bf662cbb379500052afcfe8d4c28ba5c8f6c9a5b691cead51c43a81b4c975378569e674e942d981c434722c51f6625faa758116bfa8d02
|
||||
SHA512 (crypto-hash-0.3.1.crate) = 4c4002a08e68a03409096da5b3f3c8c4db9a23bb331c54c7f4a615ad0be64e3fdca3291f4a20b682dc4bc6d13b95950f02a306423c4cecb48664df05c46209c3
|
||||
|
Loading…
Reference in new issue