mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Squashed 'OpenVPN Adapter/Vendors/openvpn/' changes from 3e002c83c..098fd412a
098fd412a [OVPN3-182] mac: add XCode project fd5fa9403 [OI-29] Report IV_HWADDR on iOS d3dd348c0 [OVPN3-165] send keydir opt string only when tls-auth is enabled d0532df66 mbedTLS: add support for ECDSA fa872c4ff [OVPN3-146] build: switch from sha256sum to shasum -a 256 git-subtree-dir: OpenVPN Adapter/Vendors/openvpn git-subtree-split: 098fd412a26b681e55e8c3de924d133f5547fd2f
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#include <openvpn/tun/win/tunutil.hpp>
|
||||
#elif defined(OPENVPN_PLATFORM_MAC)
|
||||
#include <openvpn/tun/mac/gwv4.hpp>
|
||||
#elif defined(TARGET_OS_IPHONE)
|
||||
#include <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
namespace openvpn {
|
||||
@@ -57,6 +59,13 @@ namespace openvpn {
|
||||
const MACAddr& mac = gw.hwaddr();
|
||||
return mac.to_string();
|
||||
}
|
||||
#elif defined(TARGET_OS_IPHONE)
|
||||
// as reported at https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW34
|
||||
// we can't get the MAC address from iOS for privacy reasons, but we can
|
||||
// use the UUID as unique identifier. It is unique among the App domain,
|
||||
// meaning that a different app will get a different UUID from this call
|
||||
const NSString *uuid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
|
||||
return std::string([uuid UTF8String]);
|
||||
#endif
|
||||
return std::string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user