From 188958710fa36ed9a2602fb8411de10f698212a2 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Wed, 22 Feb 2017 14:48:41 +0000 Subject: [PATCH] Download shannon dependency from crates.io --- Cargo.lock | 20 ++++---------------- Cargo.toml | 2 +- src/connection/codec.rs | 3 ++- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6648ddb4..1e63d0d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ "serde 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", - "shannon 0.1.1 (git+https://github.com/plietar/rust-shannon)", + "shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -592,21 +592,10 @@ dependencies = [ [[package]] name = "shannon" -version = "0.1.1" -source = "git+https://github.com/plietar/rust-shannon#613aa1e752b3247a30d2c866bb45f0170e9df8d6" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "shannon-sys 0.1.0 (git+https://github.com/plietar/rust-shannon)", -] - -[[package]] -name = "shannon-sys" -version = "0.1.0" -source = "git+https://github.com/plietar/rust-shannon#613aa1e752b3247a30d2c866bb45f0170e9df8d6" -dependencies = [ - "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1013,8 +1002,7 @@ dependencies = [ "checksum serde_codegen_internals 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a5113d5bd16471b183803b374f0fe4877ad9658b95e33b11f4a004d73aacc74a" "checksum serde_derive 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)" = "e88ec062a02cbebfd6276044a305d665a9919b497aa6acb2e12c070d1a50d32d" "checksum serde_json 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6501ac6f8b74f9b1033f7ddf79a08edfa0f58d6f8e3190cb8dc97736afa257a8" -"checksum shannon 0.1.1 (git+https://github.com/plietar/rust-shannon)" = "" -"checksum shannon-sys 0.1.0 (git+https://github.com/plietar/rust-shannon)" = "" +"checksum shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7ea5b41c9427b56caa7b808cb548a04fb50bb5b9e98590b53f28064ff4174561" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum syn 0.11.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0e28da8d02d75d1e58b89258e0741128f0b0d8a8309fb5c627be0fbd37a76c67" diff --git a/Cargo.toml b/Cargo.toml index e8f40ccd..a9bb7da5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ rust-crypto = "0.2.34" serde = "0.9.6" serde_json = "0.9.5" serde_derive = "0.9.6" -shannon = { git = "https://github.com/plietar/rust-shannon" } +shannon = "0.2.0" tempfile = "2.1" url = "1.3" diff --git a/src/connection/codec.rs b/src/connection/codec.rs index 968c74e5..2f657ae0 100644 --- a/src/connection/codec.rs +++ b/src/connection/codec.rs @@ -51,7 +51,8 @@ impl Codec for APCodec { self.encode_cipher.encrypt(&mut buf[offset..]); - let mac = self.encode_cipher.finish(MAC_SIZE as u32); + let mac = [0u8; MAC_SIZE]; + self.encode_cipher.finish(&mut mac); buf.extend_from_slice(&mac); Ok(())