From aab2f66351a703417c2655e7567a0b5a17350c6c Mon Sep 17 00:00:00 2001 From: Max Inden Date: Wed, 6 Oct 2021 12:22:45 +0200 Subject: [PATCH] transports/noise: Update to snow 0.8.0 (#2272) * transports/noise: Bump snow and rand * transports/noise: Bump crate version * transports/noise: Fix compilation with additional generic-array features (#2264) For crate that depends on `generic-array = { version = "0.14.3", features = ["serde", "more_lengths"] }` It's seems that `as_ref()` is ambiguous. * .github/workflows/ci.yml: Use clang 11 (#2233) * transports/noise/CHANGELOG: Add entry Co-authored-by: Alexander Popiak Co-authored-by: Sztergbaum Roman --- .github/workflows/ci.yml | 4 ++-- transports/noise/CHANGELOG.md | 6 ++++++ transports/noise/Cargo.toml | 8 ++++---- transports/noise/src/protocol/x25519.rs | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af059cf1892..54f35b1636b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: container: image: rust env: - CC: clang-10 + CC: clang-11 steps: - name: Cancel Previous Runs @@ -65,7 +65,7 @@ jobs: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" >> /etc/apt/sources.list apt-get update - apt-get install -y clang-10 + apt-get install -y clang-11 - name: Install CMake run: apt-get install -y cmake diff --git a/transports/noise/CHANGELOG.md b/transports/noise/CHANGELOG.md index 36fc76423c7..e3dd6bed27a 100644 --- a/transports/noise/CHANGELOG.md +++ b/transports/noise/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.30.1 [2021-10-06] + +- Update dependencies (see [PR 2272]). + +[PR 2272]: https://github.com/libp2p/rust-libp2p/pull/2272 + # 0.30.0 [2021-03-17] - Update `libp2p-core`. diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 1385b32291e..2bdf8079cc8 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-noise" description = "Cryptographic handshake protocol using the noise framework." -version = "0.30.0" +version = "0.30.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -15,17 +15,17 @@ lazy_static = "1.2" libp2p-core = { version = "0.28.0", path = "../../core" } log = "0.4" prost = "0.7" -rand = "0.7.2" +rand = "0.8.3" sha2 = "0.9.1" static_assertions = "1" x25519-dalek = "1.1.0" zeroize = "1" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -snow = { version = "0.7.1", features = ["ring-resolver"], default-features = false } +snow = { version = "0.8.0", features = ["ring-resolver"], default-features = false } [target.'cfg(target_arch = "wasm32")'.dependencies] -snow = { version = "0.7.1", features = ["default-resolver"], default-features = false } +snow = { version = "0.8.0", features = ["default-resolver"], default-features = false } [dev-dependencies] async-io = "1.2.0" diff --git a/transports/noise/src/protocol/x25519.rs b/transports/noise/src/protocol/x25519.rs index 389c5b94e93..d0bc953c5b5 100644 --- a/transports/noise/src/protocol/x25519.rs +++ b/transports/noise/src/protocol/x25519.rs @@ -218,7 +218,7 @@ impl SecretKey { // let ed25519_sk = ed25519::SecretKey::from(ed); let mut curve25519_sk: [u8; 32] = [0; 32]; let hash = Sha512::digest(ed25519_sk.as_ref()); - curve25519_sk.copy_from_slice(&hash.as_ref()[..32]); + curve25519_sk.copy_from_slice(&hash[..32]); let sk = SecretKey(X25519(curve25519_sk)); // Copy curve25519_sk.zeroize(); sk