mirror of
https://github.com/amnezia-vpn/OpenVPNAdapter.git
synced 2026-05-17 08:15:45 +03:00
fix: adapt OpenVPNAdapter to updated OpenVPN3 API
This commit is contained in:
@@ -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++
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user