File tree 3 files changed +8
-12
lines changed
ios/MullvadRustRuntime/include
mullvad-ios/src/ephemeral_peer_proxy
3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -114,9 +114,10 @@ void drop_ephemeral_peer_exchange_token(struct ExchangeCancelToken *sender);
114
114
* # Safety
115
115
* `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types.
116
116
* 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
+ *
120
121
*/
121
122
struct ExchangeCancelToken * request_ephemeral_peer (const uint8_t * public_key ,
122
123
const uint8_t * ephemeral_key ,
Original file line number Diff line number Diff line change @@ -31,11 +31,6 @@ impl PacketTunnelBridge {
31
31
}
32
32
}
33
33
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
39
34
unsafe impl Send for PacketTunnelBridge { }
40
35
41
36
#[ repr( C ) ]
@@ -80,9 +75,10 @@ pub unsafe extern "C" fn drop_ephemeral_peer_exchange_token(
80
75
/// # Safety
81
76
/// `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types.
82
77
/// 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
+ ///
86
82
#[ no_mangle]
87
83
pub unsafe extern "C" fn request_ephemeral_peer (
88
84
public_key : * const u8 ,
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ impl ExchangeCancelToken {
30
30
task. abort ( ) ;
31
31
// CODE STENCH:
32
32
// Swift can call this function from a tokio context. That *will* crash.
33
- // context.
34
33
let _ = inner. tokio_handle . block_on ( task) ;
35
34
}
36
35
}
You can’t perform that action at this time.
0 commit comments