diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2024-10-17 09:40:13 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2024-10-17 12:59:04 +0200 |
| commit | 541a829fe6272dc6a7985668c2c29052e3f6d779 (patch) | |
| tree | e2f488c625d08180af2f7f79aba63b2b5b9510be | |
| parent | 1ba1e04ad65755be6fe43fc813222d3b8ba8fd86 (diff) | |
| download | mullvadvpn-541a829fe6272dc6a7985668c2c29052e3f6d779.tar.xz mullvadvpn-541a829fe6272dc6a7985668c2c29052e3f6d779.zip | |
Move higher level function to above lower level function
| -rw-r--r-- | talpid-tunnel-config-client/src/lib.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/talpid-tunnel-config-client/src/lib.rs b/talpid-tunnel-config-client/src/lib.rs index 7a7b428fc6..1fb31e441b 100644 --- a/talpid-tunnel-config-client/src/lib.rs +++ b/talpid-tunnel-config-client/src/lib.rs @@ -85,6 +85,27 @@ pub struct EphemeralPeer { pub psk: Option<PresharedKey>, } +/// Negotiate a short-lived peer with a PQ-safe PSK or with DAITA enabled. +#[cfg(not(target_os = "ios"))] +pub async fn request_ephemeral_peer( + service_address: Ipv4Addr, + parent_pubkey: PublicKey, + ephemeral_pubkey: PublicKey, + enable_post_quantum: bool, + enable_daita: bool, +) -> Result<EphemeralPeer, Error> { + let client = new_client(service_address).await?; + + request_ephemeral_peer_with( + client, + parent_pubkey, + ephemeral_pubkey, + enable_post_quantum, + enable_daita, + ) + .await +} + pub async fn request_ephemeral_peer_with( mut client: RelayConfigService, parent_pubkey: PublicKey, @@ -158,27 +179,6 @@ pub async fn request_ephemeral_peer_with( Ok(EphemeralPeer { psk }) } -/// Negotiate a short-lived peer with a PQ-safe PSK or with DAITA enabled. -#[cfg(not(target_os = "ios"))] -pub async fn request_ephemeral_peer( - service_address: Ipv4Addr, - parent_pubkey: PublicKey, - ephemeral_pubkey: PublicKey, - enable_post_quantum: bool, - enable_daita: bool, -) -> Result<EphemeralPeer, Error> { - let client = new_client(service_address).await?; - - request_ephemeral_peer_with( - client, - parent_pubkey, - ephemeral_pubkey, - enable_post_quantum, - enable_daita, - ) - .await -} - async fn post_quantum_secrets() -> ( PostQuantumRequestV1, (classic_mceliece_rust::SecretKey<'static>, ml_kem::Keypair), |
