From 84e15c15a799b2a24f78ed17096f139a8a47e990 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Thu, 28 Mar 2024 01:09:03 +0800 Subject: [PATCH] add new feature for enabling ring as crypto provider. --- client/Cargo.toml | 3 ++- http/CHANGES.md | 2 +- http/Cargo.toml | 2 +- tls/CHANGES.md | 4 +++- tls/Cargo.toml | 9 +++++---- tls/src/rustls.rs | 2 +- tls/src/rustls_uring.rs | 3 ++- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index 9a2eeb95..44d2419e 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -10,6 +10,7 @@ http2 = ["h2", "itoa", "xitca-http/http2"] http3 = ["h3", "h3-quinn", "quinn/tls-rustls", "itoa", "async-stream", "rustls_0dot21", "webpki_roots_0dot25"] openssl = ["xitca-tls/openssl"] rustls = ["xitca-tls/rustls", "webpki-roots"] +rustls-ring-crypto = ["xitca-tls/rustls-ring-crypto", "webpki-roots"] compress = ["http-encoding"] json = ["serde", "serde_json"] websocket = ["http-ws"] @@ -46,7 +47,7 @@ async-stream = { version = "0.3", optional = true } itoa = { version = "1", optional = true } # tls support shared -xitca-tls = { version = "0.2.1", optional = true } +xitca-tls = { version = "0.2.2", optional = true } # rustls, http3 and dangerous features shared support webpki-roots = { version = "0.26", optional = true } diff --git a/http/CHANGES.md b/http/CHANGES.md index 55f19b2b..8777c65e 100644 --- a/http/CHANGES.md +++ b/http/CHANGES.md @@ -1,7 +1,7 @@ # unreleased 0.4.1 ## Change - update `xitca-io` to `0.2.1`. -- update `xitca-tls` to `0.2.1`. +- update `xitca-tls` to `0.2.2`. # 0.4.0 ## Add diff --git a/http/Cargo.toml b/http/Cargo.toml index 6c7e3ff6..9b88d960 100644 --- a/http/Cargo.toml +++ b/http/Cargo.toml @@ -48,7 +48,7 @@ tracing = { version = "0.1.40", default-features = false } native-tls = { version = "0.2.7", features = ["alpn"], optional = true } # tls support shared -xitca-tls = { version = "0.2.1", optional = true } +xitca-tls = { version = "0.2.2", optional = true } # http/1 support httparse = { version = "1.8", optional = true } diff --git a/tls/CHANGES.md b/tls/CHANGES.md index 115b2301..3727a017 100644 --- a/tls/CHANGES.md +++ b/tls/CHANGES.md @@ -1,4 +1,6 @@ -# unreleased +# unreleased 0.2.2 +## Add +- `rustls-ring-crypto` feature # 0.2.1 ## Add diff --git a/tls/Cargo.toml b/tls/Cargo.toml index ad1fe003..c2e2fd66 100644 --- a/tls/Cargo.toml +++ b/tls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xitca-tls" -version = "0.2.1" +version = "0.2.2" edition = "2021" license = "Apache-2.0" description = "tls utility for xitca" @@ -11,11 +11,12 @@ readme= "README.md" [features] openssl = ["dep:openssl"] -rustls = ["dep:rustls"] -rustls-uring = ["rustls", "xitca-io/runtime-uring"] +rustls = ["rustls_crate/default"] +rustls-ring-crypto = ["rustls_crate/ring"] +rustls-uring = ["rustls_crate/default", "xitca-io/runtime-uring"] [dependencies] xitca-io = { version = "0.2.1", features = ["runtime"] } -rustls = { version = "0.23", optional = true } +rustls_crate = { package = "rustls", version = "0.23", default-features = false, optional = true } openssl = { version = "0.10", optional = true } diff --git a/tls/src/rustls.rs b/tls/src/rustls.rs index 479cb03d..2ecead3d 100644 --- a/tls/src/rustls.rs +++ b/tls/src/rustls.rs @@ -7,7 +7,7 @@ use core::{ use std::io; -pub use rustls::*; +pub use rustls_crate::*; use xitca_io::io::{AsyncIo, Interest, Ready}; diff --git a/tls/src/rustls_uring.rs b/tls/src/rustls_uring.rs index ac40ff2e..19cb7303 100644 --- a/tls/src/rustls_uring.rs +++ b/tls/src/rustls_uring.rs @@ -8,7 +8,8 @@ use core::{ use std::{io, net::Shutdown}; -use rustls::{ConnectionCommon, SideData}; +pub use rustls_crate::*; + use xitca_io::{ bytes::{Buf, BytesMut}, io_uring::{AsyncBufRead, AsyncBufWrite, IoBuf, IoBufMut},