diff --git a/ios/MullvadPostQuantum/PacketTunnelProvider+TCPConnection.swift b/ios/MullvadPostQuantum/PacketTunnelProvider+TCPConnection.swift index 8b06c7b178c1..008c67cf41d6 100644 --- a/ios/MullvadPostQuantum/PacketTunnelProvider+TCPConnection.swift +++ b/ios/MullvadPostQuantum/PacketTunnelProvider+TCPConnection.swift @@ -23,7 +23,7 @@ func tcpConnectionSend( let tcpConnection = Unmanaged.fromOpaque(connection).takeUnretainedValue() let rawData = Data(bytes: data, count: Int(dataLength)) - // The guarantee that no more than 2 writes happen in parallel is done by virtue of not returning the execution context + // The guarantee that all writes are sequential is done by virtue of not returning the execution context // to Rust before this closure is done executing. tcpConnection.write(rawData, completionHandler: { maybeError in if maybeError != nil { diff --git a/ios/MullvadPostQuantum/talpid-tunnel-config-client/include/talpid_tunnel_config_client.h b/ios/MullvadPostQuantum/talpid-tunnel-config-client/include/talpid_tunnel_config_client.h index 7b9315c12fb7..3011bf63fddc 100644 --- a/ios/MullvadPostQuantum/talpid-tunnel-config-client/include/talpid_tunnel_config_client.h +++ b/ios/MullvadPostQuantum/talpid-tunnel-config-client/include/talpid_tunnel_config_client.h @@ -39,7 +39,11 @@ void handle_recv(const uint8_t *data, * Entry point for exchanging post quantum keys on iOS. * The TCP connection must be created to go through the tunnel. * # Safety - * This function is safe to call + * `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types. + * They will not be valid after this function is called, and thus must be copied here. + * `packet_tunnel` and `tcp_connection` must be valid pointers to a packet tunnel and a TCP connection + * instances. + * `cancel_token` should be owned by the caller of this function. */ int32_t negotiate_post_quantum_key(const uint8_t *public_key, const uint8_t *ephemeral_key, diff --git a/talpid-tunnel-config-client/src/ios_ffi/mod.rs b/talpid-tunnel-config-client/src/ios_ffi/mod.rs index 9941bf434060..b7835a30d9f6 100644 --- a/talpid-tunnel-config-client/src/ios_ffi/mod.rs +++ b/talpid-tunnel-config-client/src/ios_ffi/mod.rs @@ -85,7 +85,11 @@ pub unsafe extern "C" fn handle_recv(data: *const u8, data_len: usize, sender: * /// Entry point for exchanging post quantum keys on iOS. /// The TCP connection must be created to go through the tunnel. /// # Safety -/// This function is safe to call +/// `public_key` and `ephemeral_key` must be valid respective `PublicKey` and `PrivateKey` types. +/// They will not be valid after this function is called, and thus must be copied here. +/// `packet_tunnel` and `tcp_connection` must be valid pointers to a packet tunnel and a TCP connection +/// instances. +/// `cancel_token` should be owned by the caller of this function. #[no_mangle] pub unsafe extern "C" fn negotiate_post_quantum_key( public_key: *const u8,