Skip to content

Commit 0ba177b

Browse files
committed
Merge branch 'reuse-the-same-tokio-runtime-in-packettunnel-ios-596'
2 parents b6fe083 + 2df280f commit 0ba177b

File tree

58 files changed

+705
-1422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+705
-1422
lines changed

Cargo.lock

+17-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ rust-version = "1.77.0"
99
resolver = "2"
1010
members = [
1111
"android/translations-converter",
12-
"ios/MullvadREST/Transport/Shadowsocks/shadowsocks-proxy",
13-
"ios/TunnelObfuscation/tunnel-obfuscator-proxy",
1412
"mullvad-api",
1513
"mullvad-cli",
1614
"mullvad-daemon",
1715
"mullvad-exclude",
1816
"mullvad-fs",
17+
"mullvad-ios",
1918
"mullvad-jni",
2019
"mullvad-management-interface",
2120
"mullvad-nsis",
@@ -39,7 +38,7 @@ members = [
3938
"talpid-windows",
4039
"talpid-wireguard",
4140
"tunnel-obfuscation",
42-
"wireguard-go-rs"
41+
"wireguard-go-rs",
4342
]
4443

4544
# Keep all lints in sync with `test/Cargo.toml`
@@ -81,7 +80,7 @@ shadowsocks-service = { version = "1.16" }
8180

8281
windows-sys = "0.52.0"
8382

84-
chrono = { version = "0.4.26", default-features = false}
83+
chrono = { version = "0.4.26", default-features = false }
8584
clap = { version = "4.4.18", features = ["cargo", "derive"] }
8685
once_cell = "1.13"
8786

ios/MullvadPostQuantum/MullvadPostQuantum.h

-10
This file was deleted.

ios/MullvadPostQuantum/module.private.modulemap

-5
This file was deleted.

ios/MullvadPostQuantum/talpid-tunnel-config-client/include/talpid_tunnel_config_client.h

-89
Original file line numberDiff line numberDiff line change
@@ -7,92 +7,3 @@
77
* Port used by the tunnel config service.
88
*/
99
#define CONFIG_SERVICE_PORT 1337
10-
11-
typedef struct PostQuantumCancelToken {
12-
void *context;
13-
} PostQuantumCancelToken;
14-
15-
/**
16-
* Called by the Swift side to signal that the quantum-secure key exchange should be cancelled.
17-
*
18-
* # Safety
19-
* `sender` must be pointing to a valid instance of a `PostQuantumCancelToken` created by the
20-
* `PacketTunnelProvider`.
21-
*/
22-
void cancel_post_quantum_key_exchange(const struct PostQuantumCancelToken *sender);
23-
24-
/**
25-
* Called by the Swift side to signal that the Rust `PostQuantumCancelToken` can be safely dropped
26-
* from memory.
27-
*
28-
* # Safety
29-
* `sender` must be pointing to a valid instance of a `PostQuantumCancelToken` created by the
30-
* `PacketTunnelProvider`.
31-
*/
32-
void drop_post_quantum_key_exchange_token(const struct PostQuantumCancelToken *sender);
33-
34-
/**
35-
* Called by Swift whenever data has been written to the in-tunnel TCP connection when exchanging
36-
* quantum-resistant pre shared keys.
37-
*
38-
* If `bytes_sent` is 0, this indicates that the connection was closed or that an error occurred.
39-
*
40-
* # Safety
41-
* `sender` must be pointing to a valid instance of a `write_tx` created by the `IosTcpProvider`
42-
* Callback to call when the TCP connection has written data.
43-
*/
44-
void handle_sent(uintptr_t bytes_sent, const void *sender);
45-
46-
/**
47-
* Called by Swift whenever data has been read from the in-tunnel TCP connection when exchanging
48-
* quantum-resistant pre shared keys.
49-
*
50-
* If `data` is null or empty, this indicates that the connection was closed or that an error
51-
* occurred. An empty buffer is sent to the underlying reader to signal EOF.
52-
*
53-
* # Safety
54-
* `sender` must be pointing to a valid instance of a `read_tx` created by the `IosTcpProvider`
55-
*
56-
* Callback to call when the TCP connection has received data.
57-
*/
58-
void handle_recv(const uint8_t *data, uintptr_t data_len, const void *sender);
59-
60-
/**
61-
* Entry point for exchanging post quantum keys on iOS.
62-
* The TCP connection must be created to go through the tunnel.
63-
* # Safety
64-
* `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types.
65-
* They will not be valid after this function is called, and thus must be copied here.
66-
* `packet_tunnel` and `tcp_connection` must be valid pointers to a packet tunnel and a TCP
67-
* connection instances.
68-
* `cancel_token` should be owned by the caller of this function.
69-
*/
70-
int32_t negotiate_post_quantum_key(const uint8_t *public_key,
71-
const uint8_t *ephemeral_key,
72-
const void *packet_tunnel,
73-
const void *tcp_connection,
74-
struct PostQuantumCancelToken *cancel_token,
75-
uint64_t post_quantum_key_exchange_timeout);
76-
77-
/**
78-
* Called when there is data to send on the TCP connection.
79-
* The TCP connection must write data on the wire, then call the `handle_sent` function.
80-
*/
81-
extern void swift_nw_tcp_connection_send(const void *connection,
82-
const void *data,
83-
uintptr_t data_len,
84-
const void *sender);
85-
86-
/**
87-
* Called when there is data to read on the TCP connection.
88-
* The TCP connection must read data from the wire, then call the `handle_read` function.
89-
*/
90-
extern void swift_nw_tcp_connection_read(const void *connection, const void *sender);
91-
92-
/**
93-
* Called when the preshared post quantum key is ready.
94-
* `raw_preshared_key` might be NULL if the key negotiation failed.
95-
*/
96-
extern void swift_post_quantum_key_ready(const void *raw_packet_tunnel,
97-
const uint8_t *raw_preshared_key,
98-
const uint8_t *raw_ephemeral_private_key);

ios/MullvadREST/Transport/Shadowsocks/ShadowsocksTransport.swift

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import Foundation
10+
import MullvadRustRuntime
1011
import MullvadTypes
1112

1213
public final class ShadowsocksTransport: RESTTransport {

ios/MullvadREST/Transport/Shadowsocks/module.private.modulemap

-5
This file was deleted.

ios/MullvadREST/Transport/Shadowsocks/shadowsocks-proxy/Cargo.toml

-26
This file was deleted.

ios/MullvadREST/Transport/Shadowsocks/shadowsocks-proxy/build.rs

-14
This file was deleted.

ios/MullvadREST/Transport/Shadowsocks/shadowsocks-proxy/include/shadowsocks.h

-36
This file was deleted.

ios/MullvadREST/Transport/Shadowsocks/shadowsocks-proxy/src/bin/run.rs

-20
This file was deleted.

ios/MullvadREST/Transport/Shadowsocks/shadowsocks-proxy/src/bin/run_unsafe.rs

-58
This file was deleted.

0 commit comments

Comments
 (0)