i2ptunnel: Change enctype default to both for:

HTTP, IRC, and Streamr servers
IRC, SOCKS IRC, and Streamr clients
This commit is contained in:
zzz
2020-09-22 14:52:55 +00:00
parent 7dd7f021b0
commit ea4409897d
3 changed files with 20 additions and 5 deletions

View File

@@ -852,6 +852,8 @@ public class TunnelController implements Logging {
}
if (!_config.containsKey(OPT_BUNDLE_REPLY))
_config.setProperty(OPT_BUNDLE_REPLY, "false");
if (!_config.containsKey(OPT_ENCTYPE))
_config.setProperty(OPT_ENCTYPE, "4,0");
} else if (!isClient(type)) {
// override UI that sets it to false
_config.setProperty(OPT_BUNDLE_REPLY, "true");
@@ -862,6 +864,8 @@ public class TunnelController implements Logging {
_config.setProperty(OPT_TAGS_SEND, "20");
if (!_config.containsKey(OPT_LOW_TAGS))
_config.setProperty(OPT_LOW_TAGS, "14");
if (!_config.containsKey(OPT_ENCTYPE))
_config.setProperty(OPT_ENCTYPE, "4,0");
}
// same default logic as in EditBean.getSigType() and GeneralHelper.getSigType()
if (!isClient(type) ||

View File

@@ -755,11 +755,19 @@ public class GeneralHelper {
return encType == 4 || encType == 0;
}
// migration: HTTP proxy and shared clients default to both
String type = tun.getType();
String dflt;
if (tun.isClient() &&
(TunnelController.TYPE_HTTP_CLIENT.equals(tun.getType()) ||
(TunnelController.TYPE_HTTP_CLIENT.equals(type) ||
TunnelController.TYPE_IRC_CLIENT.equals(type) ||
TunnelController.TYPE_SOCKS_IRC.equals(type) ||
TunnelController.TYPE_STREAMR_CLIENT.equals(type) ||
Boolean.parseBoolean(tun.getSharedClient()))) {
dflt = "4,0";
} else if (TunnelController.TYPE_HTTP_SERVER.equals(type) ||
TunnelController.TYPE_IRC_SERVER.equals(type) ||
TunnelController.TYPE_STREAMR_SERVER.equals(type)) {
dflt = "4,0";
} else {
dflt = "0";
}

View File

@@ -844,12 +844,15 @@ public class TunnelConfig {
// As of 0.9.18, add persistent leaseset keys if not present
// but only if we know the sigtype
// TODO: Put server enctype migration here
// Server enctype migration here
String dflt;
//if (...)
// dflt = "4,0";
//else
if (TunnelController.TYPE_HTTP_SERVER.equals(_type) ||
TunnelController.TYPE_IRC_SERVER.equals(_type) ||
TunnelController.TYPE_STREAMR_SERVER.equals(_type)) {
dflt = "4,0";
} else {
dflt = "0";
}
String senc = config.getProperty(OPT + "i2cp.leaseSetEncType", dflt);
String slstyp = config.getProperty(OPT + "i2cp.leaseSetType", "0");
if (senc.equals("0") && slstyp.equals("0")) {