fix: adapt OpenVPNAdapter to updated OpenVPN3 API

This commit is contained in:
spectrum
2026-03-11 16:34:33 +02:00
parent b39ef7b8a5
commit bc89255ce6
6 changed files with 15 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ TARGETED_DEVICE_FAMILY = 1,2
HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/Sources/OpenVPNAdapter/include $(SRCROOT)/Sources/OpenVPNClient/include $(SRCROOT)/Sources/LZ4/include $(SRCROOT)/Sources/mbedTLS/include $(SRCROOT)/Sources/ASIO/asio/include $(SRCROOT)/Sources/OpenVPN3
CLANG_CXX_LANGUAGE_STANDARD = gnu++14
CLANG_CXX_LANGUAGE_STANDARD = gnu++17
CLANG_CXX_LIBRARY = libc++
////////////////////////////////////////////////////////////////////////////////

View File

@@ -55,7 +55,7 @@ Pod::Spec.new do |s|
s.xcconfig = {
"APPLICATION_EXTENSION_API_ONLY" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14",
"CLANG_CXX_LANGUAGE_STANDARD" => "gnu++17",
"CLANG_CXX_LIBRARY" => "libc++",
"GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO",
"CLANG_WARN_DOCUMENTATION_COMMENTS" => "NO",

View File

@@ -94,6 +94,7 @@ public:
void external_pki_sign_request(ClientAPI::ExternalPKISignRequest& signreq) override;
void event(const ClientAPI::Event& event) override;
void acc_event(const ClientAPI::AppCustomControlMessageEvent& event) override;
void log(const ClientAPI::LogInfo& log) override;
void clock_tick() override;
@@ -103,4 +104,3 @@ private:
ClientAPI::Config * _Nullable config;
};

View File

@@ -185,6 +185,10 @@ void OpenVPNClient::event(const ClientAPI::Event& ev) {
}
}
void OpenVPNClient::acc_event(const ClientAPI::AppCustomControlMessageEvent& ev) {
(void)ev;
}
void OpenVPNClient::log(const ClientAPI::LogInfo& log) {
NSString *logMessage = [NSString stringWithUTF8String:log.text.c_str()];
[this->delegate clientLogMessage:logMessage];

View File

@@ -215,7 +215,8 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default";
@implementation OpenVPNConfiguration
- (void)setPTCloak {
_config.usePluggableTransports = TRUE;
// OpenVPN3 no longer exposes Config.usePluggableTransports.
// Keep the adapter API intact while the actual PT behavior is configured elsewhere.
}
- (NSData *)fileContent {

View File

@@ -13,6 +13,8 @@ using namespace openvpn;
@interface OpenVPNCredentials () {
ClientAPI::ProvideCreds _credentials;
BOOL _replacePasswordWithSessionID;
BOOL _cachePassword;
}
@end
@@ -61,19 +63,19 @@ using namespace openvpn;
}
- (BOOL)replacePasswordWithSessionID {
return _credentials.replacePasswordWithSessionID;
return _replacePasswordWithSessionID;
}
- (void)setReplacePasswordWithSessionID:(BOOL)replacePasswordWithSessionID {
_credentials.replacePasswordWithSessionID = replacePasswordWithSessionID;
_replacePasswordWithSessionID = replacePasswordWithSessionID;
}
- (BOOL)cachePassword {
return _credentials.cachePassword;
return _cachePassword;
}
- (void)setCachePassword:(BOOL)cachePassword {
_credentials.cachePassword = cachePassword;
_cachePassword = cachePassword;
}
@end