Skip to content

Commit

Permalink
transports/noise: Update to snow 0.8.0 (#2272)
Browse files Browse the repository at this point in the history
* 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 <alexander.popiak@parity.io>
Co-authored-by: Sztergbaum Roman <rmscastle@gmail.com>
  • Loading branch information
3 people committed Oct 6, 2021
1 parent 40c4287 commit 054d512
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
container:
image: rust
env:
CC: clang-10
CC: clang-11
steps:

- name: Cancel Previous Runs
Expand Down Expand Up @@ -75,7 +75,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
Expand Down
6 changes: 6 additions & 0 deletions transports/noise/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
8 changes: 4 additions & 4 deletions transports/noise/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion transports/noise/src/protocol/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl SecretKey<X25519> {
// 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
Expand Down

0 comments on commit 054d512

Please sign in to comment.