Skip to content

Commit

Permalink
Remove unneeded parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
buggmagnet committed Aug 23, 2024
1 parent 7bd2a79 commit 62b3c6d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ios/MullvadRustRuntime/EphemeralPeerExchangeActor.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// PostQuantumKeyExchangeActor.swift
// EphemeralPeerExchangeActor.swift
// PacketTunnel
//
// Created by Marco Nikic on 2024-04-12.
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadRustRuntime/include/mullvad_rust_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ extern void swift_nw_tcp_connection_read(const void *connection, const void *sen
*/
extern void swift_ephemeral_peer_ready(const void *raw_packet_tunnel,
const uint8_t *raw_preshared_key,
const uint8_t *raw_ephemeral_private_key,
bool daita_enabled);
const uint8_t *raw_ephemeral_private_key);

/**
* # Safety
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ final class MultiHopEphemeralPeerExchangerTests: XCTestCase {
)
}

//TODO: Write more tests
// TODO: Write more tests
func testEphemeralPeerExchangeSuccessWhenDaitaNegotiationStarts() throws {
let unexpectedNegotiationFailure = expectation(description: "Negotiation failed.")
unexpectedNegotiationFailure.isInverted = true
Expand Down
13 changes: 4 additions & 9 deletions mullvad-ios/src/post_quantum_proxy/ios_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ impl IOSRuntime {
self.packet_tunnel.packet_tunnel,
ptr::null(),
ptr::null(),
self.enable_daita,
);
return;
}
Expand Down Expand Up @@ -167,16 +166,14 @@ impl IOSRuntime {
let preshared_key_bytes = preshared_key.as_bytes();
swift_ephemeral_peer_ready(self.packet_tunnel.packet_tunnel,
preshared_key_bytes.as_ptr(),
self.ephemeral_key.as_ptr(),
self.enable_daita);
self.ephemeral_key.as_ptr());
},
None => {
// Daita peer was requested, but without enabling post quantum keys
unsafe {
swift_ephemeral_peer_ready(self.packet_tunnel.packet_tunnel,
ptr::null(),
self.ephemeral_key.as_ptr(),
self.enable_daita);
self.ephemeral_key.as_ptr());
}
}
}
Expand All @@ -186,8 +183,7 @@ impl IOSRuntime {
unsafe {
swift_ephemeral_peer_ready(self.packet_tunnel.packet_tunnel,
ptr::null(),
ptr::null(),
self.enable_daita);
ptr::null());
}
}
}
Expand All @@ -200,8 +196,7 @@ impl IOSRuntime {
shutdown_handle.shutdown();
unsafe { swift_ephemeral_peer_ready(self.packet_tunnel.packet_tunnel,
ptr::null(),
ptr::null(),
self.enable_daita); }
ptr::null()); }
}
}
}
Expand Down
1 change: 0 additions & 1 deletion mullvad-ios/src/post_quantum_proxy/ios_tcp_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ extern "C" {
raw_packet_tunnel: *const c_void,
raw_preshared_key: *const u8,
raw_ephemeral_private_key: *const u8,
daita_enabled: bool,
);
}

Expand Down

0 comments on commit 62b3c6d

Please sign in to comment.