From 9da66c35d48b658a89ac2d975c7d48009c2ae0c2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 5 Mar 2018 16:19:05 -0800 Subject: [PATCH] Update to 0.3.1 --- .gitignore | 1 + 0001-Upgrade-to-hex-0.3.patch | 64 -------------------------- 0001-deps-update-openssl-to-0.10.patch | 26 ----------- crypto-hash-0.3.0-fix-metadata.diff | 19 -------- crypto-hash-0.3.1-fix-metadata.diff | 14 ++++++ rust-crypto-hash.spec | 15 +++--- sources | 2 +- 7 files changed, 22 insertions(+), 119 deletions(-) delete mode 100644 0001-Upgrade-to-hex-0.3.patch delete mode 100644 0001-deps-update-openssl-to-0.10.patch delete mode 100644 crypto-hash-0.3.0-fix-metadata.diff create mode 100644 crypto-hash-0.3.1-fix-metadata.diff diff --git a/.gitignore b/.gitignore index e47f42f..d7da033 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /crypto-hash-0.3.0.crate +/crypto-hash-0.3.1.crate diff --git a/0001-Upgrade-to-hex-0.3.patch b/0001-Upgrade-to-hex-0.3.patch deleted file mode 100644 index fcaf8a6..0000000 --- a/0001-Upgrade-to-hex-0.3.patch +++ /dev/null @@ -1,64 +0,0 @@ -From d47183116ab10b53703c999eb0eccc85f6e1f89d Mon Sep 17 00:00:00 2001 -From: Mark Lee -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 { - /// 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 - diff --git a/0001-deps-update-openssl-to-0.10.patch b/0001-deps-update-openssl-to-0.10.patch deleted file mode 100644 index c1ac28a..0000000 --- a/0001-deps-update-openssl-to-0.10.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 962774effab9b47b52ae69bcafaa31006769452c Mon Sep 17 00:00:00 2001 -From: Alexandra Nikandrova -Date: Sat, 13 Jan 2018 18:28:48 +0100 -Subject: [PATCH] deps: update openssl to 0.10 - -Signed-off-by: Alexandra Nikandrova ---- - 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 { - 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 - diff --git a/crypto-hash-0.3.0-fix-metadata.diff b/crypto-hash-0.3.0-fix-metadata.diff deleted file mode 100644 index 27c949e..0000000 --- a/crypto-hash-0.3.0-fix-metadata.diff +++ /dev/null @@ -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" diff --git a/crypto-hash-0.3.1-fix-metadata.diff b/crypto-hash-0.3.1-fix-metadata.diff new file mode 100644 index 0000000..6e15d42 --- /dev/null +++ b/crypto-hash-0.3.1-fix-metadata.diff @@ -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" + diff --git a/rust-crypto-hash.spec b/rust-crypto-hash.spec index f3151b2..896c85f 100644 --- a/rust-crypto-hash.spec +++ b/rust-crypto-hash.spec @@ -5,8 +5,8 @@ %global crate crypto-hash Name: rust-%{crate} -Version: 0.3.0 -Release: 2%{?dist} +Version: 0.3.1 +Release: 1%{?dist} Summary: Wrapper for OS-level cryptographic hash functions License: MIT @@ -14,13 +14,7 @@ URL: https://crates.io/crates/crypto-hash Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate # Initial patched metadata # * No windows/osx -# * Bump hex to 0.3, https://github.com/malept/crypto-hash/commit/7036d94acc843e2a03d14d7c47de352a7be411cb -# * Bump openssl to 0.10, https://github.com/malept/crypto-hash/pull/1 -Patch0: crypto-hash-0.3.0-fix-metadata.diff -# Make it work with hex v0.3 -Patch1: 0001-Upgrade-to-hex-0.3.patch -# Make it work with openssl v0.10 -Patch2: 0001-deps-update-openssl-to-0.10.patch +Patch0: crypto-hash-0.3.1-fix-metadata.diff ExclusiveArch: %{rust_arches} @@ -64,6 +58,9 @@ which use %{crate} from crates.io. %exclude %{cargo_registry}/%{crate}-%{version}/Makefile %changelog +* Tue Mar 06 2018 Josh Stone - 0.3.1-1 +- Update to 0.3.1 + * Fri Feb 09 2018 Fedora Release Engineering - 0.3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index abe1ce6..583de1a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (crypto-hash-0.3.0.crate) = 226755b61e7d75ff73bf662cbb379500052afcfe8d4c28ba5c8f6c9a5b691cead51c43a81b4c975378569e674e942d981c434722c51f6625faa758116bfa8d02 +SHA512 (crypto-hash-0.3.1.crate) = 4c4002a08e68a03409096da5b3f3c8c4db9a23bb331c54c7f4a615ad0be64e3fdca3291f4a20b682dc4bc6d13b95950f02a306423c4cecb48664df05c46209c3