Skip to content

Commit

Permalink
Security: Update trust-dns-resolver (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
markmandel authored Aug 22, 2023
1 parent 3ee2d20 commit 1fc3954
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ url = { version = "2.3.1", features = ["serde"] }
uuid = { version = "1.3.3", default-features = false, features = ["v4"] }
lasso = { version = "0.7.2", features = ["multi-threaded"] }
kube.workspace = true
trust-dns-resolver = { version = "0.21.0", features = ["tokio", "tokio-rustls", "dns-over-https-rustls"] }
trust-dns-resolver = { version = "0.23.0", features = ["tokio", "tokio-rustls", "dns-over-https-rustls"] }
async-trait = "0.1.68"
nom = "7.1.3"

Expand Down
4 changes: 2 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ default = "allow"
exceptions = [
# Each entry is the crate and version constraint, and its specific allow
# list
{ name ="webpki-roots", version = "0.23.0", allow = ["MPL-2.0"] },
{ name ="webpki-roots", version = "0.22.0", allow = ["MPL-2.0"] },
{ name ="webpki-roots", version = "0.25.0", allow = ["MPL-2.0"] },
{ name ="webpki-roots", version = "0.23.0", allow = ["MPL-2.0"] }
]

[[licenses.clarify]]
Expand Down
10 changes: 3 additions & 7 deletions src/endpoint/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ use std::{

use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use trust_dns_resolver::{
name_server::{GenericConnection, GenericConnectionProvider, TokioRuntime},
AsyncResolver,
};
use trust_dns_resolver::{AsyncResolver, TokioAsyncResolver};

use crate::xds::config::core::v3::{
address::Address as EnvoyAddress, SocketAddress as EnvoySocketAddress,
Expand Down Expand Up @@ -64,9 +61,8 @@ impl EndpointAddress {
/// Returns the socket address for the endpoint, resolving any DNS entries
/// if present.
pub async fn to_socket_addr(&self) -> std::io::Result<SocketAddr> {
static DNS: Lazy<
AsyncResolver<GenericConnection, GenericConnectionProvider<TokioRuntime>>,
> = Lazy::new(|| AsyncResolver::tokio_from_system_conf().unwrap());
static DNS: Lazy<TokioAsyncResolver> =
Lazy::new(|| AsyncResolver::tokio_from_system_conf().unwrap());

let ip = match &self.host {
AddressKind::Ip(ip) => *ip,
Expand Down

0 comments on commit 1fc3954

Please sign in to comment.