1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
[package]
name = "tor-rtcompat"
version = "0.43.0"
authors = ["The Tor Project, Inc.", "Nick Mathewson <[email protected]>"]
edition = "2024"
rust-version = "1.89"
license = "MIT OR Apache-2.0"
homepage = "https://gitlab.torproject.org/tpo/core/arti/-/wikis/home"
description = "Compatibility layer for asynchronous runtimes, used by Tor"
keywords = ["tor", "arti", "async"]
categories = ["asynchronous"]
repository = "https://gitlab.torproject.org/tpo/core/arti.git/"
[package.metadata.docs.rs]
all-features = true
[features]
default = []
full = [
"arbitrary",
"async-std",
"tokio",
"native-tls",
"tls-server",
"tor-error/full",
"tor-general-addr/full",
"tor-cert-x509?/full",
"web-time-compat/full",
]
experimental = ["smol", "testing"]
__is_experimental = []
async-std = ["async-std-crate", "async-io", "async_executors/async_std"]
tokio = [
"tokio-crate",
"tokio-util",
"async_executors/tokio_tp",
"async_executors/tokio_timer",
"async_executors/tokio_io",
]
smol = ["dep:smol", "async-io", "blocking", "__is_experimental"]
static = ["native-tls-crate?/vendored", "__is_nonadditive"]
native-tls = ["native-tls-crate", "async-native-tls"]
testing = ["__is_experimental", "futures-rustls?/aws-lc-rs"]
# This is not nonadditive from a software POV, but we mark it as such because it
# includes code licensed under the old OpenSSL license (which was 4-clause BSD),
# which in turn introduces a GPL-incompatibility.
rustls = [
"futures-rustls",
"dep:rustls-dont-use",
"rustls-pki-types",
"rustls-webpki",
"__is_nonadditive",
]
# Build with TLS server support, if possible.
tls-server = ["tor-cert-x509"]
__is_nonadditive = []
[dependencies]
amplify = { version = "4", default-features = false, features = ["derive"] }
arbitrary = { version = "1.3.2", optional = true, features = ["derive"] }
async-io = { version = "2.2.1", optional = true }
async-native-tls = { version = "0.6.0", optional = true }
async-std-crate = { package = "async-std", version = "1.7.0", optional = true }
async-trait = "0.1.54"
async_executors = { version = "0.7.0", default-features = false }
asynchronous-codec = "0.7.0"
blocking = { version = "1.6.2", optional = true }
cfg-if = "1.0.0"
coarsetime = "0.1.20"
derive_builder = { version = "0.11", package = "derive_builder_fork_arti" }
derive_more = { version = "2.0.1", features = ["full"] }
dyn-clone = "1.0.17"
educe = "0.4.22"
futures = "0.3.14"
futures-rustls = { version = "0.26.0", optional = true, default-features = false, features = [
"tls12",
"logging",
] }
hex = "0.4.3"
native-tls-crate = { package = "native-tls", version = "0.2", optional = true }
paste = "1.0.3"
pin-project = "1"
# We access the rustls library through the `futures_rustls::rustls` re-export,
# but we still rely on specific rustls features which became available in a version later than
# futures_rustls' minimum rustls version (for example `ServerCertVerifier::root_hint_subjects`).
# So we need to specify our own minimum version of rustls,
# and we rename it so that we continue to use rustls from only the futures_rustls re-export.
rustls-dont-use = { package = "rustls", version = "0.23.21", default-features = false, optional = true }
rustls-pki-types = { version = "1.8", optional = true }
rustls-webpki = { version = "0.103.1", optional = true }
smol = { version = "2.0.2", optional = true }
thiserror = "2"
tokio-crate = { package = "tokio", version = "1.7", optional = true, features = [
"rt",
"rt-multi-thread",
"io-util",
"net",
"time",
] }
tokio-util = { version = "0.7.0", features = ["compat"], optional = true }
tor-cert-x509 = { version = "0.43.0", path = "../tor-cert-x509", optional = true }
tor-error = { version = "0.43.0", path = "../tor-error", features = ["tracing"] }
tor-general-addr = { version = "0.43.0", path = "../tor-general-addr" }
tracing = "0.1.36"
void = "1"
web-time-compat = { version = "0.1.0", path = "../web-time-compat" }
zeroize = "1"
[target.'cfg(not(all(target_arch="wasm32", target_os="unknown")))'.dependencies]
socket2 = "0.6.1"
[target.'cfg(target_os = "linux")'.dependencies]
libc = "0.2"
[dev-dependencies]
assert_matches = "1.5.0"
# Used for testing our TLS implementation.
native-tls-crate = { package = "native-tls", version = "0.2" }
tor-basic-utils = { version = "0.43.0", path = "../tor-basic-utils" }
# Ensure that we have aws-lc-rs for testing, but only if we're building with rustls.
# (We need to do it this way because we can't have conditional dev-dependencies.)
#
# Note the lack of `version =`. This is to work around a bug in cargo: it refuses to
# publish this crate if we specify the version, because it sees that before publication,
# this self-dependency is not satisfied.
#
# Omitting the version causes the .crate file to omit that dependency, which means
# that any downstream using the .crate won't be able to run the tests.
#
# https://github.com/rust-lang/cargo/issues/4242
tor-rtcompat-testing = { package = "tor-rtcompat", path = ".", features = ["testing"] }
|