aboutsummaryrefslogtreecommitdiff
path: root/p2p
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-06-24 20:26:03 +0200
committerhozan23 <hozan23@karyontech.net>2024-06-24 20:26:03 +0200
commit1a3ef2d77ab54bfe286f7400ac0cee2e25ea14e3 (patch)
tree9014082443fffbfc7951c03b33caf48b3b0d6a68 /p2p
parentf3bb85508335eab91fbd76d15e74dcc575195acf (diff)
update dependencies
Diffstat (limited to 'p2p')
-rw-r--r--p2p/Cargo.toml20
-rw-r--r--p2p/examples/tokio-example/Cargo.toml4
-rw-r--r--p2p/src/tls_config.rs8
3 files changed, 15 insertions, 17 deletions
diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml
index 7eee02a..3f61fee 100644
--- a/p2p/Cargo.toml
+++ b/p2p/Cargo.toml
@@ -29,30 +29,30 @@ karyon_net = { workspace = true, default-features = false, features = [
log = "0.4.21"
-chrono = "0.4.35"
+chrono = "0.4.38"
rand = "0.8.5"
-thiserror = "1.0.58"
-semver = "1.0.22"
+thiserror = "1.0.61"
+semver = "1.0.23"
sha2 = "0.10.8"
-parking_lot = "0.12.2"
+parking_lot = "0.12.3"
# encode/decode
bincode = { version = "2.0.0-rc.3", features = ["derive"] }
base64 = "0.22.1"
-serde = { version = "1.0.197", features = ["derive"], optional = true }
+serde = { version = "1.0.203", features = ["derive"], optional = true }
# async
-async-trait = "0.1.77"
-async-channel = "2.3.0"
+async-trait = "0.1.80"
+async-channel = "2.3.1"
futures-util = { version = "0.3.5", features = [
"alloc",
], default-features = false }
# tls
-rcgen = "0.12.1"
+rcgen = "0.13.1"
yasna = "0.5.2"
x509-parser = "0.16.0"
-futures-rustls = { version = "0.25.1", features = [
+futures-rustls = { version = "0.26.0", features = [
"aws-lc-rs",
], optional = true }
tokio-rustls = { version = "0.26.0", features = ["aws-lc-rs"], optional = true }
@@ -60,7 +60,7 @@ rustls-pki-types = "1.7.0"
[dev-dependencies]
async-std = "1.12.0"
-clap = { version = "4.5.2", features = ["derive"] }
+clap = { version = "4.5.7", features = ["derive"] }
ctrlc = "3.4.4"
easy-parallel = "3.3.1"
env_logger = "0.11.3"
diff --git a/p2p/examples/tokio-example/Cargo.toml b/p2p/examples/tokio-example/Cargo.toml
index 5604677..7971c85 100644
--- a/p2p/examples/tokio-example/Cargo.toml
+++ b/p2p/examples/tokio-example/Cargo.toml
@@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
karyon_p2p = { path = "../../", default-features = false, features = ["tokio"] }
async-channel = "2.3.1"
-tokio = { version = "1.37.0", features = ["full"] }
-clap = { version = "4.5.4", features = ["derive"] }
+tokio = { version = "1.38.0", features = ["full"] }
+clap = { version = "4.5.7", features = ["derive"] }
ctrlc = "3.4.4"
env_logger = "0.11.3"
diff --git a/p2p/src/tls_config.rs b/p2p/src/tls_config.rs
index 65d2adc..b1141a4 100644
--- a/p2p/src/tls_config.rs
+++ b/p2p/src/tls_config.rs
@@ -82,7 +82,7 @@ pub fn tls_server_config(key_pair: &KeyPair) -> Result<rustls::ServerConfig> {
/// Generates a certificate and returns both the certificate and the private key.
fn generate_cert<'a>(key_pair: &KeyPair) -> Result<(CertificateDer<'a>, PrivateKeyDer<'a>)> {
- let cert_key_pair = rcgen::KeyPair::generate(&rcgen::PKCS_ED25519)?;
+ let cert_key_pair = rcgen::KeyPair::generate_for(&rcgen::PKCS_ED25519)?;
let private_key = PrivateKeyDer::Pkcs8(cert_key_pair.serialize_der().into());
// Add a custom extension to the certificate:
@@ -94,12 +94,10 @@ fn generate_cert<'a>(key_pair: &KeyPair) -> Result<(CertificateDer<'a>, PrivateK
let mut ext = rcgen::CustomExtension::from_oid_content(&[0, 0, 0, 0], ext_content);
ext.set_criticality(true);
- let mut params = rcgen::CertificateParams::new(vec![]);
- params.alg = &rcgen::PKCS_ED25519;
- params.key_pair = Some(cert_key_pair);
+ let mut params = rcgen::CertificateParams::new(vec![])?;
params.custom_extensions.push(ext);
- let cert = CertificateDer::from(rcgen::Certificate::from_params(params)?.serialize_der()?);
+ let cert = CertificateDer::from(params.self_signed(&cert_key_pair)?);
Ok((cert, private_key))
}