diff --git a/Cargo.lock b/Cargo.lock index 28738c67..a0c24dcb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -127,21 +127,20 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-lc-rs" -version = "1.8.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +checksum = "f409eb70b561706bf8abba8ca9c112729c481595893fd06a2dd9af8ed8441148" dependencies = [ "aws-lc-sys", - "mirai-annotations", "paste", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.20.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +checksum = "8478a5c29ead3f3be14aff8a202ad965cf7da6856860041bfca271becf8ba48b" dependencies = [ "bindgen", "cc", @@ -175,9 +174,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags", "cexpr", @@ -223,12 +222,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.7.1" @@ -343,9 +336,9 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" dependencies = [ "core-foundation-sys", "libc", @@ -393,26 +386,22 @@ version = "0.1.0" dependencies = [ "async-trait", "base64", - "bytes 1.7.1", + "bytes", "chrono", "clap", "futures-util", "hex", "hmac", "lru", - "openssl", "rand 0.8.5", "rust-crypto", "rustls", "rustls-native-certs", "sha2", "thiserror", - "tokio 1.39.2", + "tokio", "tokio-rustls", "tokio-stream", - "tokio-tls", - "webpki", - "webpki-roots", ] [[package]] @@ -437,27 +426,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "fs_extra" version = "1.3.0" @@ -502,7 +470,7 @@ dependencies = [ "futures-core", "futures-macro", "futures-task", - "pin-project-lite 0.2.14", + "pin-project-lite", "pin-utils", "slab", ] @@ -740,29 +708,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "mirai-annotations" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nom" version = "7.1.3" @@ -797,50 +742,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -870,12 +777,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - [[package]] name = "pin-project-lite" version = "0.2.14" @@ -888,12 +789,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -1107,9 +1002,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "aws-lc-rs", "log", @@ -1122,38 +1017,27 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" -dependencies = [ - "base64", - "rustls-pki-types", -] - [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", "ring", @@ -1163,11 +1047,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1178,9 +1062,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.11.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "81d3f8c9bfcc3cbb6b0179eb57042d75b1582bdc65c3cb95f3fa999509c03cbc" dependencies = [ "bitflags", "core-foundation", @@ -1191,9 +1075,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -1279,19 +1163,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "thiserror" version = "1.0.63" @@ -1323,16 +1194,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "tokio" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" -dependencies = [ - "bytes 0.5.6", - "pin-project-lite 0.1.12", -] - [[package]] name = "tokio" version = "1.39.2" @@ -1340,11 +1201,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", - "bytes 1.7.1", + "bytes", "libc", "mio", "parking_lot", - "pin-project-lite 0.2.14", + "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", @@ -1364,13 +1225,12 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", - "tokio 1.39.2", + "tokio", ] [[package]] @@ -1380,18 +1240,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", - "pin-project-lite 0.2.14", - "tokio 1.39.2", -] - -[[package]] -name = "tokio-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" -dependencies = [ - "native-tls", - "tokio 0.2.25", + "pin-project-lite", + "tokio", ] [[package]] @@ -1418,12 +1268,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1497,25 +1341,6 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "which" version = "4.4.2" @@ -1667,17 +1492,3 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index c791c402..dd06893f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,13 +20,9 @@ sha2 = "0.10.2" hmac = "0.12.1" rust-crypto = "0.2" base64 = "0.22.1" -tokio-tls = "0.3.1" lru = "0.12.3" rustls = "0.23.12" -openssl = "0.10.66" tokio-rustls = "0.26.0" -webpki = "0.22.4" -webpki-roots = "0.26.3" rustls-native-certs = "0.8.0" [lib] doctest = false diff --git a/src/async_resolver.rs b/src/async_resolver.rs index 01dbe989..94e370bd 100644 --- a/src/async_resolver.rs +++ b/src/async_resolver.rs @@ -23,8 +23,6 @@ use std::net::IpAddr; use std::time::SystemTime; use std::sync::{Arc, Mutex}; use std::vec; -use std::collections::HashMap; - /// Asynchronous resolver for DNS queries. /// /// This struct contains a cache and a configuration for the resolver. diff --git a/src/client.rs b/src/client.rs index 131866a4..2c3b20a0 100644 --- a/src/client.rs +++ b/src/client.rs @@ -5,15 +5,13 @@ pub mod tls_connection; pub mod udp_connection; pub mod client_error; -use crate::message::rdata::Rdata; use crate::message::rrtype::Rrtype; use crate::client::client_connection::ClientConnection; use crate::message::DnsMessage; use crate::domain_name::DomainName; -use rustls::Connection; -use rustls::ClientConfig; + use rand::{thread_rng, Rng}; use self::client_error::ClientError; diff --git a/src/client/tcp_connection.rs b/src/client/tcp_connection.rs index c9c7cb2d..79f77606 100644 --- a/src/client/tcp_connection.rs +++ b/src/client/tcp_connection.rs @@ -5,15 +5,8 @@ use crate::message::rdata::a_rdata::ARdata; use crate::message::resource_record::ResourceRecord; use super::client_error::ClientError; use async_trait::async_trait; -use futures_util::TryFutureExt; -use rustls::pki_types::ServerName; -use rustls::server; -use rustls::Stream; -use webpki::DnsNameRef; -use std::convert::TryFrom; use std::io::Error as IoError; use std::io::ErrorKind; -use std::iter::FromIterator; use tokio::io::AsyncWriteExt; use tokio::io::AsyncReadExt; use tokio::net::TcpStream; @@ -21,9 +14,6 @@ use std::net::IpAddr; use std::net::SocketAddr; use tokio::time::Duration; use tokio::time::timeout; -use tokio_rustls::rustls::ClientConfig; -use tokio_rustls::TlsConnector; -use std::sync::Arc; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct ClientTCPConnection { diff --git a/src/client/tls_connection.rs b/src/client/tls_connection.rs index 1d188e1c..ff3cc557 100644 --- a/src/client/tls_connection.rs +++ b/src/client/tls_connection.rs @@ -1,23 +1,15 @@ -use crate::client::ClientConnection; + use crate::message::DnsMessage; use crate::message::rdata::Rdata; use crate::message::rdata::a_rdata::ARdata; use crate::message::resource_record::ResourceRecord; -use super::client_connection::ConnectionProtocol; use super::client_error::ClientError; use super::client_security::ClientSecurity; use async_trait::async_trait; -use futures_util::TryFutureExt; use rustls::pki_types::ServerName; -use rustls::server; -use rustls::Stream; -use rustls::RootCertStore; -use webpki::DnsNameRef; use std::convert::TryFrom; use std::io::Error as IoError; use std::io::ErrorKind; -use std::io::Write; -use std::iter::FromIterator; use tokio::io::AsyncWriteExt; use tokio::io::AsyncReadExt; use tokio::net::TcpStream; @@ -27,7 +19,6 @@ use tokio::time::Duration; use tokio::time::timeout; use tokio_rustls::rustls::ClientConfig; use tokio_rustls::TlsConnector; -use tokio_rustls::TlsStream; use std::sync::Arc; #[derive(Clone, Copy, Debug, PartialEq, Eq)] diff --git a/src/example.rs b/src/example.rs index 1f6a7eaf..43349ba1 100644 --- a/src/example.rs +++ b/src/example.rs @@ -1,4 +1,3 @@ pub mod dotcp; pub mod dotls; -pub mod doudp; -pub mod resolverexample; \ No newline at end of file +pub mod doudp; \ No newline at end of file diff --git a/src/example/dotls.rs b/src/example/dotls.rs index a2ff3b5e..9c9a740d 100644 --- a/src/example/dotls.rs +++ b/src/example/dotls.rs @@ -1,9 +1,7 @@ -use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; +use std::net::{IpAddr, Ipv4Addr}; use std::time::Duration; use tokio::runtime::Runtime; -use crate::client::client_connection::ClientConnection; use crate::client::client_security::ClientSecurity; -use crate::client::tcp_connection::ClientTCPConnection; use crate::client::tls_connection::ClientTLSConnection; use crate::domain_name::DomainName; use crate::message::rclass::Rclass; @@ -24,7 +22,7 @@ fn main() -> Result<(), ClientError> { Rclass::IN, 0, false, - 1);; + 1); rt.block_on(async { match tls_connection.send(dns_query).await {