Update deps
moparisthebest/xmpp-proxy/pipeline/head This commit looks good Details

This commit is contained in:
Travis Burtrum 2023-12-19 23:16:39 -05:00
parent 42aed6cbb2
commit 3122cfb1ff
Signed by: moparisthebest
GPG Key ID: 88C93BFE27BC8229
6 changed files with 448 additions and 508 deletions

925
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -26,15 +26,15 @@ include = [
] ]
[dependencies] [dependencies]
toml = "0.7" toml = "0.8"
serde_derive = "1.0" serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
futures = "0.3" futures = "0.3"
die = "0.2" die = "0.2"
anyhow = "1.0" anyhow = "1.0"
tokio = { version = "1.9", features = ["net", "rt", "rt-multi-thread", "macros", "io-util", "signal", "time"] } tokio = { version = "1.35", features = ["net", "rt", "rt-multi-thread", "macros", "io-util", "signal", "time"] }
ring = "0.16" ring = "0.17"
data-encoding = "2.3" data-encoding = "2.5"
async-trait = "0.1" async-trait = "0.1"
@ -49,7 +49,7 @@ webpki = { package = "rustls-webpki", version = "0.101", optional = true }
# outgoing deps # outgoing deps
lazy_static = "1.4" lazy_static = "1.4"
trust-dns-resolver = { version = "0.22", optional = true } trust-dns-resolver = { version = "0.23", optional = true }
# todo: feature+code for dns-over-rustls # todo: feature+code for dns-over-rustls
#trust-dns-resolver = { version = "0.21", features = ["dns-over-rustls"], optional = true } #trust-dns-resolver = { version = "0.21", features = ["dns-over-rustls"], optional = true }
webpki-roots = { version = "0.25", optional = true } webpki-roots = { version = "0.25", optional = true }
@ -65,14 +65,14 @@ rustls = { version = "0.21", optional = true, features = ["dangerous_configurati
rustls-pemfile = { version = "1.0", optional = true } rustls-pemfile = { version = "1.0", optional = true }
# websocket deps # websocket deps
tokio-tungstenite = { version = "0.19", optional = true, default-features = false, features = ["handshake"] } tokio-tungstenite = { version = "0.21", optional = true, default-features = false, features = ["handshake"] }
futures-util = { version = "0.3", default-features = false, features = ["async-await", "sink", "std"], optional = true } futures-util = { version = "0.3", default-features = false, features = ["async-await", "sink", "std"], optional = true }
# webtransport deps # webtransport deps
webtransport-quinn = { version = "0.6", optional = true } webtransport-quinn = { version = "0.6", optional = true }
# systemd dep # systemd dep
nix = { version = "0.26", optional = true, default-features = false, features = ["socket"]} nix = { version = "0.27", optional = true, default-features = false, features = ["socket"]}
[features] [features]
default = ["c2s-incoming", "c2s-outgoing", "s2s-incoming", "s2s-outgoing", "tls", "quic", "websocket", "webtransport", "logging", "tls-ca-roots-native", "systemd"] default = ["c2s-incoming", "c2s-outgoing", "s2s-incoming", "s2s-outgoing", "tls", "quic", "websocket", "webtransport", "logging", "tls-ca-roots-native", "systemd"]

View File

@ -7,8 +7,8 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
afl = "0.12.12" afl = "0.15.1"
xmpp-proxy = { path = "..", default-features = false, features = [] } xmpp-proxy = { path = "..", default-features = false, features = [] }
tokio = { version = "1.9", features = ["net", "rt", "rt-multi-thread", "macros", "io-util"] } tokio = { version = "1.35", features = ["net", "rt", "rt-multi-thread", "macros", "io-util"] }
sha256 = "1.1.1" sha256 = "1.4.0"
rxml = "0.9.1" rxml = "0.9.1"

View File

@ -39,7 +39,7 @@ lazy_static::lazy_static! {
fn make_resolver() -> TokioAsyncResolver { fn make_resolver() -> TokioAsyncResolver {
let (config, mut options) = trust_dns_resolver::system_conf::read_system_conf().unwrap(); let (config, mut options) = trust_dns_resolver::system_conf::read_system_conf().unwrap();
options.ip_strategy = trust_dns_resolver::config::LookupIpStrategy::Ipv4AndIpv6; options.ip_strategy = trust_dns_resolver::config::LookupIpStrategy::Ipv4AndIpv6;
TokioAsyncResolver::tokio(config, options).unwrap() TokioAsyncResolver::tokio(config, options)
} }
fn make_https_client() -> Client { fn make_https_client() -> Client {

View File

@ -1,5 +1,6 @@
use anyhow::{anyhow, bail, Result}; use anyhow::{anyhow, bail, Result};
use nix::sys::socket::{getsockname, getsockopt, AddressFamily, SockType, SockaddrLike, SockaddrStorage}; use nix::sys::socket::{getsockname, getsockopt, AddressFamily, SockType, SockaddrLike, SockaddrStorage};
use std::os::fd::BorrowedFd;
use std::{ use std::{
env, env,
net::{TcpListener, UdpSocket}, net::{TcpListener, UdpSocket},
@ -114,11 +115,13 @@ fn socks_from_fds(num_fds: usize, names: Vec<String>) -> Result<Vec<FileDescript
} }
fn sock_listening(raw_fd: RawFd) -> bool { fn sock_listening(raw_fd: RawFd) -> bool {
getsockopt(raw_fd, nix::sys::socket::sockopt::AcceptConn).unwrap_or(false) let raw_fd = unsafe { BorrowedFd::borrow_raw(raw_fd) };
getsockopt(&raw_fd, nix::sys::socket::sockopt::AcceptConn).unwrap_or(false)
} }
fn sock_type(raw_fd: RawFd) -> Option<SockType> { fn sock_type(raw_fd: RawFd) -> Option<SockType> {
getsockopt(raw_fd, nix::sys::socket::sockopt::SockType).ok() let raw_fd = unsafe { BorrowedFd::borrow_raw(raw_fd) };
getsockopt(&raw_fd, nix::sys::socket::sockopt::SockType).ok()
} }
fn address_family(raw_fd: RawFd) -> Option<AddressFamily> { fn address_family(raw_fd: RawFd) -> Option<AddressFamily> {

View File

@ -23,10 +23,10 @@ pub type WsRd = SplitStream<WebSocketStream<BoxAsyncReadWrite>>;
fn ws_cfg(max_stanza_size_bytes: usize) -> Option<WebSocketConfig> { fn ws_cfg(max_stanza_size_bytes: usize) -> Option<WebSocketConfig> {
Some(WebSocketConfig { Some(WebSocketConfig {
max_send_queue: None, // unlimited
max_frame_size: Some(max_stanza_size_bytes), // this is exactly the stanza size max_frame_size: Some(max_stanza_size_bytes), // this is exactly the stanza size
max_message_size: Some(max_stanza_size_bytes * 4), // this is the message size, default is 4x frame size, so I guess we'll do the same here max_message_size: Some(max_stanza_size_bytes * 4), // this is the message size, default is 4x frame size, so I guess we'll do the same here
accept_unmasked_frames: true, accept_unmasked_frames: true,
..Default::default()
}) })
} }