Skip to content

Commit

Permalink
Merge pull request #359 from nervosnetwork/reexport-openssl-vendored
Browse files Browse the repository at this point in the history
Reexport openssl vendored
  • Loading branch information
driftluo authored Jul 29, 2022
2 parents ca569bd + 108770f commit 19907a9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.1

### Features
- Re-export openssl vendored

## 0.4.0

### Bug Fix
Expand Down
2 changes: 2 additions & 0 deletions multiaddr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name = "tentacle-multiaddr"
version = "0.3.3"
authors = ["driftluo <driftluo@foxmail.com>"]
edition = "2021"
license = "MIT"
description = "Mini Implementation of multiaddr"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
5 changes: 4 additions & 1 deletion secio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle-secio"
version = "0.5.5"
version = "0.5.6"
license = "MIT"
description = "Secio encryption protocol for p2p"
authors = ["piaoliu <driftluo@foxmail.com>", "Nervos Core Dev <dev@nervos.org>"]
Expand Down Expand Up @@ -44,6 +44,9 @@ hmac = "0.12.0"
x25519-dalek = "1.1"
chacha20poly1305 = "0.9"

[features]
openssl-vendored = ["openssl/vendored"]

[dev-dependencies]
env_logger = "0.6"
criterion = "0.3"
Expand Down
7 changes: 3 additions & 4 deletions secio/src/codec/hmac_compat/openssl_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ impl Hmac {

/// Signs the data.
pub fn sign(&mut self, crypted_data: &[u8]) -> Vec<u8> {
Signer::new(self.digest, &self.key)
.expect("init openssl signer ctx fail")
.sign_oneshot_to_vec(crypted_data)
.expect("hmac sign oneshot fail")
let mut sign = Signer::new(self.digest, &self.key).expect("init openssl signer ctx fail");
sign.update(crypted_data).expect("openssl hmac update fail");
sign.sign_to_vec().expect("hmac sign oneshot fail")
}

/// Verifies that the data matches the expected hash.
Expand Down
4 changes: 3 additions & 1 deletion tentacle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle"
version = "0.4.0"
version = "0.4.1"
license = "MIT"
description = "Minimal implementation for a multiplexed p2p network framework."
authors = ["piaoliu <driftluo@foxmail.com>", "Nervos Core Dev <dev@nervos.org>"]
Expand Down Expand Up @@ -78,6 +78,8 @@ tls = ["tokio-rustls"]
upnp = ["igd"]
unstable = []

openssl-vendored = ["secio/openssl-vendored"]

# Related to runtime

tokio-timer = ["yamux/tokio-timer", "tokio/time", "tokio-runtime"]
Expand Down

0 comments on commit 19907a9

Please sign in to comment.