Skip to content

Commit c030b79

Browse files
committed
Update docs
1 parent 102e9f4 commit c030b79

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

ios/MullvadRustRuntime/include/mullvad_rust_runtime.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ void drop_ephemeral_peer_exchange_token(struct ExchangeCancelToken *sender);
114114
* # Safety
115115
* `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types.
116116
* They will not be valid after this function is called, and thus must be copied here.
117-
* `packet_tunnel` and `tcp_connection` must be valid pointers to a packet tunnel and a TCP
118-
* connection instances.
119-
* `cancel_token` should be owned by the caller of this function.
117+
* `packet_tunnel` must be valid pointers to a packet tunnel, the packet tunnel pointer must
118+
* outlive the ephemeral peer exchange. `cancel_token` should be owned by the caller of this
119+
* function.
120+
*
120121
*/
121122
struct ExchangeCancelToken *request_ephemeral_peer(const uint8_t *public_key,
122123
const uint8_t *ephemeral_key,

mullvad-ios/src/ephemeral_peer_proxy/mod.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ impl PacketTunnelBridge {
3131
}
3232
}
3333

34-
// # Safety
35-
// This is safe as long as the PacketTunnel class outlives the instance of the PacketTunnelBridge,
36-
// and thus the ephemeral peer exchange. Since the peer exchange takes place in the packet tunnel
37-
// process on iOS, it is certain _enough_ this will be the case.
38-
// It is safe to implement Send for PacketTunnelBridge because the packet_tunnel
3934
unsafe impl Send for PacketTunnelBridge {}
4035

4136
#[repr(C)]
@@ -80,9 +75,10 @@ pub unsafe extern "C" fn drop_ephemeral_peer_exchange_token(
8075
/// # Safety
8176
/// `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types.
8277
/// They will not be valid after this function is called, and thus must be copied here.
83-
/// `packet_tunnel` and `tcp_connection` must be valid pointers to a packet tunnel and a TCP
84-
/// connection instances.
85-
/// `cancel_token` should be owned by the caller of this function.
78+
/// `packet_tunnel` must be valid pointers to a packet tunnel, the packet tunnel pointer must
79+
/// outlive the ephemeral peer exchange. `cancel_token` should be owned by the caller of this
80+
/// function.
81+
///
8682
#[no_mangle]
8783
pub unsafe extern "C" fn request_ephemeral_peer(
8884
public_key: *const u8,

mullvad-ios/src/ephemeral_peer_proxy/peer_exchange.rs

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ impl ExchangeCancelToken {
3030
task.abort();
3131
// CODE STENCH:
3232
// Swift can call this function from a tokio context. That *will* crash.
33-
// context.
3433
let _ = inner.tokio_handle.block_on(task);
3534
}
3635
}

0 commit comments

Comments
 (0)