Merge branch 'dev' of github.com:/zerotier/ZeroTierOne into dev

This commit is contained in:
Adam Ierymenko 2023-03-07 16:47:30 -05:00
commit 64423f3a09
5 changed files with 144 additions and 32 deletions

95
SECURITY.md Normal file
View File

@ -0,0 +1,95 @@
# Security
ZeroTier takes the security of our software products and services seriously, which
includes all source code repositories managed through our GitHub organization.
## Supported Versions
The following versions of ZeroTier One receive security updates
| Version | Supported |
| ------- | ------------------ |
| 1.10.x | :white_check_mark: |
| 1.8.x | :white_check_mark: |
| < 1.8.0 | :x: |
## Reporting a Vulnerability
**Please do not report security issues through public GitHub issues**
Instead, please report vulnerabilities via email to security@zerotier.com. If possible,
please encrypt with our PGP key (see below).
Please include the following information, or as much as you can provide to help us
understand the nature and scope of the issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
## Preferred Languages
We prefer all communications to be in English.
## security@zerotier.com PGP key
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGQGOVIBEACalXTnNqaiSOVLFEiqHpDMg8N/OI5D5850Xy1ZEvx3B3rz7cbn
k30ozHtJKbh+vqpyItE7DjyQAuF19gP5Q64Yh0Y+MmLHq60q/GwOwAYz7cI+UzA3
5x8YqcmTp32LAM1xJn+iMlMLBuAmJl4kULKmOXPlpqPiyTFs5saizvm7fgRmfgJJ
HpsnIrTkaDFJhAR+jvMJohVYwmhuydeI0DsHu7KGpG1ddcHDrUjOPNqXnnAPSPwx
llw4yfKlQb8GYErsv/G5QVyzd5+SxEuiI4MARRnrk8LlMQ33CR6pzIQ/Bk5AAmye
mHqfEAknkiOf++urYhRs9BL3Kz3MdV0cg92zr9EFOg0u56jxf5OnAiTOhGUUA0hn
dS7peVGl46R9Oy2JYIazNDGi+4NIsYDFXsnsss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
lH4T5A5ib7y8edon1c0Zx3GsaxJUojkEJ0SX7ffVDu6ztUZfkHfCVpMW4VzUeGA/
m+CtFO9ciLRGZEkRa+zhIGoBvwEXU0GiwiF4nZ0F2C8UioeW0YIEV9zl3nXJctYE
ZKc2whSENQRTGgaYHVoVZhznt71LKWgFLshwBo81UCXVkzwAjMW1ActDnmPw5M7q
xR5Qp5G49Z1GmfSozazha0HVFPKNV5i3RlTzs4yLUnZyH0yC9IvtOefMHcLjG96L
N5miEV97gvJJjrn8rhRvpUwAWgmT/9IuYjBNQTtNN40arto5HxezR76WCjdKYxdL
p3dM1iiBDShHNm7LdyZlLFhTOMU0tNBxJJ7B09ar5gakeZjD+2aB1ODX9VuFtozL
onBjI2gIkry0UIkuznHfFw05lZAZAiqHEVgVi/WTk4C/bklDZNgE0lx+IWzEz2iS
L455
=lheL
-----END PGP PUBLIC KEY BLOCK-----
```

View File

@ -176,7 +176,15 @@ void setupJNICache(JavaVM *vm) {
EXCEPTIONANDNULLCHECK(Peer_ctor = env->GetMethodID(Peer_class, "<init>", "(JIIIILcom/zerotier/sdk/PeerRole;[Lcom/zerotier/sdk/PeerPhysicalPath;)V")); EXCEPTIONANDNULLCHECK(Peer_ctor = env->GetMethodID(Peer_class, "<init>", "(JIIIILcom/zerotier/sdk/PeerRole;[Lcom/zerotier/sdk/PeerPhysicalPath;)V"));
EXCEPTIONANDNULLCHECK(Version_ctor = env->GetMethodID(Version_class, "<init>", "(III)V")); EXCEPTIONANDNULLCHECK(Version_ctor = env->GetMethodID(Version_class, "<init>", "(III)V"));
EXCEPTIONANDNULLCHECK(VirtualNetworkConfigListener_onNetworkConfigurationUpdated_method = env->GetMethodID(VirtualNetworkConfigListener_class, "onNetworkConfigurationUpdated", "(JLcom/zerotier/sdk/VirtualNetworkConfigOperation;Lcom/zerotier/sdk/VirtualNetworkConfig;)I")); EXCEPTIONANDNULLCHECK(VirtualNetworkConfigListener_onNetworkConfigurationUpdated_method = env->GetMethodID(VirtualNetworkConfigListener_class, "onNetworkConfigurationUpdated", "(JLcom/zerotier/sdk/VirtualNetworkConfigOperation;Lcom/zerotier/sdk/VirtualNetworkConfig;)I"));
EXCEPTIONANDNULLCHECK(VirtualNetworkConfig_ctor = env->GetMethodID(VirtualNetworkConfig_class, "<init>", "(JJLjava/lang/String;Lcom/zerotier/sdk/VirtualNetworkStatus;Lcom/zerotier/sdk/VirtualNetworkType;IZZZIJ[Ljava/net/InetSocketAddress;[Lcom/zerotier/sdk/VirtualNetworkRoute;Lcom/zerotier/sdk/VirtualNetworkDNS;)V"));
//
// ANDROID-56: temporarily remove parameters to prevent crashing
//
// EXCEPTIONANDNULLCHECK(VirtualNetworkConfig_ctor = env->GetMethodID(VirtualNetworkConfig_class, "<init>", "(JJLjava/lang/String;Lcom/zerotier/sdk/VirtualNetworkStatus;Lcom/zerotier/sdk/VirtualNetworkType;IZZZIJ[Ljava/net/InetSocketAddress;[Lcom/zerotier/sdk/VirtualNetworkRoute;Lcom/zerotier/sdk/VirtualNetworkDNS;)V"));
EXCEPTIONANDNULLCHECK(VirtualNetworkConfig_ctor = env->GetMethodID(VirtualNetworkConfig_class, "<init>", "(JJLjava/lang/String;Lcom/zerotier/sdk/VirtualNetworkStatus;Lcom/zerotier/sdk/VirtualNetworkType;IZZZ[Ljava/net/InetSocketAddress;[Lcom/zerotier/sdk/VirtualNetworkRoute;Lcom/zerotier/sdk/VirtualNetworkDNS;)V"));
EXCEPTIONANDNULLCHECK(VirtualNetworkDNS_ctor = env->GetMethodID(VirtualNetworkDNS_class, "<init>", "(Ljava/lang/String;Ljava/util/ArrayList;)V")); EXCEPTIONANDNULLCHECK(VirtualNetworkDNS_ctor = env->GetMethodID(VirtualNetworkDNS_class, "<init>", "(Ljava/lang/String;Ljava/util/ArrayList;)V"));
EXCEPTIONANDNULLCHECK(VirtualNetworkFrameListener_onVirtualNetworkFrame_method = env->GetMethodID(VirtualNetworkFrameListener_class, "onVirtualNetworkFrame", "(JJJJJ[B)V")); EXCEPTIONANDNULLCHECK(VirtualNetworkFrameListener_onVirtualNetworkFrame_method = env->GetMethodID(VirtualNetworkFrameListener_class, "onVirtualNetworkFrame", "(JJJJJ[B)V"));
EXCEPTIONANDNULLCHECK(VirtualNetworkRoute_ctor = env->GetMethodID(VirtualNetworkRoute_class, "<init>", "(Ljava/net/InetSocketAddress;Ljava/net/InetSocketAddress;II)V")); EXCEPTIONANDNULLCHECK(VirtualNetworkRoute_ctor = env->GetMethodID(VirtualNetworkRoute_class, "<init>", "(Ljava/net/InetSocketAddress;Ljava/net/InetSocketAddress;II)V"));

View File

@ -307,8 +307,11 @@ jobject newNetworkConfig(JNIEnv *env, const ZT_VirtualNetworkConfig &vnetConfig)
vnetConfig.dhcp, vnetConfig.dhcp,
vnetConfig.bridge, vnetConfig.bridge,
vnetConfig.broadcastEnabled, vnetConfig.broadcastEnabled,
vnetConfig.portError, //
vnetConfig.netconfRevision, // ANDROID-56: temporarily remove parameters to prevent crashing
//
// vnetConfig.portError,
// vnetConfig.netconfRevision,
assignedAddrArrayObj, assignedAddrArrayObj,
routesArrayObj, routesArrayObj,
dnsObj); dnsObj);

View File

@ -66,9 +66,12 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
private final boolean broadcastEnabled; private final boolean broadcastEnabled;
private final int portError; //
// ANDROID-56: temporarily remove parameters to prevent crashing
private final long netconfRevision; //
// private final int portError;
//
// private final long netconfRevision;
private final InetSocketAddress[] assignedAddresses; private final InetSocketAddress[] assignedAddresses;
@ -76,7 +79,7 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
private final VirtualNetworkDNS dns; private final VirtualNetworkDNS dns;
public VirtualNetworkConfig(long nwid, long mac, String name, VirtualNetworkStatus status, VirtualNetworkType type, int mtu, boolean dhcp, boolean bridge, boolean broadcastEnabled, int portError, long netconfRevision, InetSocketAddress[] assignedAddresses, VirtualNetworkRoute[] routes, VirtualNetworkDNS dns) { public VirtualNetworkConfig(long nwid, long mac, String name, VirtualNetworkStatus status, VirtualNetworkType type, int mtu, boolean dhcp, boolean bridge, boolean broadcastEnabled, InetSocketAddress[] assignedAddresses, VirtualNetworkRoute[] routes, VirtualNetworkDNS dns) {
this.nwid = nwid; this.nwid = nwid;
this.mac = mac; this.mac = mac;
this.name = name; this.name = name;
@ -89,11 +92,11 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
this.dhcp = dhcp; this.dhcp = dhcp;
this.bridge = bridge; this.bridge = bridge;
this.broadcastEnabled = broadcastEnabled; this.broadcastEnabled = broadcastEnabled;
this.portError = portError; // this.portError = portError;
if (netconfRevision < 0) { // if (netconfRevision < 0) {
throw new RuntimeException("netconfRevision < 0: " + netconfRevision); // throw new RuntimeException("netconfRevision < 0: " + netconfRevision);
} // }
this.netconfRevision = netconfRevision; // this.netconfRevision = netconfRevision;
this.assignedAddresses = assignedAddresses; this.assignedAddresses = assignedAddresses;
this.routes = routes; this.routes = routes;
this.dns = dns; this.dns = dns;
@ -101,7 +104,7 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
@Override @Override
public String toString() { public String toString() {
return "VirtualNetworkConfig(" + StringUtils.networkIdToString(nwid) + ", " + StringUtils.macAddressToString(mac) + ", " + name + ", " + status + ", " + type + ", " + mtu + ", " + dhcp + ", " + bridge + ", " + broadcastEnabled + ", " + portError + ", " + netconfRevision + ", " + Arrays.toString(assignedAddresses) + ", " + Arrays.toString(routes) + ", " + dns + ")"; return "VirtualNetworkConfig(" + StringUtils.networkIdToString(nwid) + ", " + StringUtils.macAddressToString(mac) + ", " + name + ", " + status + ", " + type + ", " + mtu + ", " + dhcp + ", " + bridge + ", " + broadcastEnabled + ", " + Arrays.toString(assignedAddresses) + ", " + Arrays.toString(routes) + ", " + dns + ")";
} }
@Override @Override
@ -168,17 +171,17 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
return false; return false;
} }
if (this.portError != cfg.portError) { // if (this.portError != cfg.portError) {
Log.i(TAG, "Port Error Changed. Old: " + this.portError + ", New: " + cfg.portError); // Log.i(TAG, "Port Error Changed. Old: " + this.portError + ", New: " + cfg.portError);
//
return false; // return false;
} // }
//
if (this.netconfRevision != cfg.netconfRevision) { // if (this.netconfRevision != cfg.netconfRevision) {
Log.i(TAG, "NetConfRevision Changed. Old: " + this.netconfRevision + ", New: " + cfg.netconfRevision); // Log.i(TAG, "NetConfRevision Changed. Old: " + this.netconfRevision + ", New: " + cfg.netconfRevision);
//
return false; // return false;
} // }
if (!Arrays.equals(assignedAddresses, cfg.assignedAddresses)) { if (!Arrays.equals(assignedAddresses, cfg.assignedAddresses)) {
@ -277,8 +280,8 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
result = 37 * result + (dhcp ? 1 : 0); result = 37 * result + (dhcp ? 1 : 0);
result = 37 * result + (bridge ? 1 : 0); result = 37 * result + (bridge ? 1 : 0);
result = 37 * result + (broadcastEnabled ? 1 : 0); result = 37 * result + (broadcastEnabled ? 1 : 0);
result = 37 * result + portError; // result = 37 * result + portError;
result = 37 * result + (int) (netconfRevision ^ (netconfRevision >>> 32)); // result = 37 * result + (int) (netconfRevision ^ (netconfRevision >>> 32));
result = 37 * result + Arrays.hashCode(assignedAddresses); result = 37 * result + Arrays.hashCode(assignedAddresses);
result = 37 * result + Arrays.hashCode(routes); result = 37 * result + Arrays.hashCode(routes);
result = 37 * result + (dns == null ? 0 : dns.hashCode()); result = 37 * result + (dns == null ? 0 : dns.hashCode());
@ -359,18 +362,18 @@ public class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
/** /**
* If the network is in PORT_ERROR state, this is the error most recently returned by the port config callback * If the network is in PORT_ERROR state, this is the error most recently returned by the port config callback
*/ */
public int getPortError() { // public int getPortError() {
return portError; // return portError;
} // }
/** /**
* Network config revision as reported by netconf master * Network config revision as reported by netconf master
* *
* <p>If this is zero, it means we're still waiting for our netconf.</p> * <p>If this is zero, it means we're still waiting for our netconf.</p>
*/ */
public long getNetconfRevision() { // public long getNetconfRevision() {
return netconfRevision; // return netconfRevision;
} // }
/** /**
* ZeroTier-assigned addresses (in {@link InetSocketAddress} objects) * ZeroTier-assigned addresses (in {@link InetSocketAddress} objects)

View File

@ -146,6 +146,9 @@ endif
ifeq ($(CC_MACH),e2k) ifeq ($(CC_MACH),e2k)
ZT_ARCHITECTURE=2 ZT_ARCHITECTURE=2
endif endif
ifeq ($(CC_MACH),e2k64)
ZT_ARCHITECTURE=2
endif
ifeq ($(CC_MACH),i386) ifeq ($(CC_MACH),i386)
ZT_ARCHITECTURE=1 ZT_ARCHITECTURE=1
ZT_SSO_SUPPORTED=1 ZT_SSO_SUPPORTED=1