diff options
author | Arne Schwabe <arne@rfc2549.org> | 2022-03-16 11:32:07 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2022-03-16 11:32:07 +0100 |
commit | 2ccc153ecc3fb89ba8a78b8a4c4e08aaf28e1575 (patch) | |
tree | 625312e350809ada6886b562799447f84acf86ec /main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java | |
parent | af8772c3da512935ff45b0b8ff2eee9313f3b81a (diff) |
Also set fake mac address with OpenVPN 2.x
The OpenVPN 2.x part of actually sending IV_HWADDR from env is still
mising.
Diffstat (limited to 'main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java index 927cb14d..780fa217 100644 --- a/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java +++ b/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java @@ -189,7 +189,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable config.setExternalPkiAlias("extpki"); config.setCompressionMode("asym"); - config.setHwAddrOverride(getFakeMacAddrFromSAAID(mService)); + config.setHwAddrOverride(NetworkUtils.getFakeMacAddrFromSAAID(mService)); config.setInfo(true); config.setAllowLocalLanAccess(mVp.mAllowLocalLAN); boolean retryOnAuthFailed = mVp.mAuthRetry == AUTH_RETRY_NOINTERACT; @@ -213,28 +213,6 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable } } - @SuppressLint("HardwareIds") - private String getFakeMacAddrFromSAAID(Context c) { - char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray(); - - String saaid = Settings.Secure.getString(c.getContentResolver(), - Settings.Secure.ANDROID_ID); - - StringBuilder ret = new StringBuilder(); - if (saaid.length() >= 6) { - byte[] sb = saaid.getBytes(); - for (int b = 0; b <= 6; b++) { - if (b != 0) - ret.append(":"); - int v = sb[b] & 0xFF; - ret.append(HEX_ARRAY[v >>> 4]); - ret.append(HEX_ARRAY[v & 0x0F]); - } - } - return ret.toString(); - } - - @Override public void external_pki_cert_request(ClientAPI_ExternalPKICertRequest certreq) { VpnStatus.logDebug("Got external PKI certificate request from OpenVPN core"); |