blob: 77c15edf4794dcd2a092909ecc284174510a7d34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
//
// KeyExchangingResultStub.swift
// MullvadPostQuantumTests
//
// Created by Mojgan on 2024-07-19.
// Copyright © 2025 Mullvad VPN AB. All rights reserved.
//
@testable import MullvadRustRuntime
@testable import MullvadTypes
@testable import WireGuardKitTypes
struct KeyExchangingResultStub: EphemeralPeerReceiving {
var onFailure: (() -> Void)?
var onReceivePostQuantumKey: ((PreSharedKey, PrivateKey, DaitaV2Parameters?) async -> Void)?
var onReceiveEphemeralPeerPrivateKey: ((PrivateKey, DaitaV2Parameters?) async -> Void)?
func receivePostQuantumKey(
_ key: PreSharedKey,
ephemeralKey: PrivateKey,
daitaParameters: DaitaV2Parameters?
) async {
await onReceivePostQuantumKey?(key, ephemeralKey, daitaParameters)
}
public func receiveEphemeralPeerPrivateKey(
_ ephemeralPeerPrivateKey: PrivateKey,
daitaParameters daitaParameters: MullvadTypes.DaitaV2Parameters?
) async {
await onReceiveEphemeralPeerPrivateKey?(ephemeralPeerPrivateKey, daitaParameters)
}
func ephemeralPeerExchangeFailed() {
onFailure?()
}
}
|