i2ptunnel: Change default encType to both for new tunnels,

http client, shared clients, and all tunnels for new installs (ticket #2751)
Change IRC tunnel sigType to EdDSA for new installs (ticket #2749)
This commit is contained in:
zzz
2020-07-22 15:34:43 +00:00
parent 4d3561c92a
commit 896dbfbacf
6 changed files with 47 additions and 5 deletions

View File

@ -143,6 +143,8 @@ public class TunnelController implements Logging {
private static final String OPT_LIMIT_ACTION = PFX_OPTION + PROP_LIMIT_ACTION;
private static final String OPT_I2CP_GZIP = PFX_OPTION + I2PClient.PROP_GZIP;
private static final String OPT_ENCTYPE = PFX_OPTION + "i2cp.leaseSetEncType";
/** all of these @since 0.9.14 */
public static final String TYPE_CONNECT = "connectclient";
public static final String TYPE_HTTP_BIDIR_SERVER = "httpbidirserver";
@ -900,6 +902,12 @@ public class TunnelController implements Logging {
}
}
}
if (isClient(type) &&
(type.equals(TYPE_HTTP_CLIENT) || Boolean.valueOf(_config.getProperty(PROP_SHARED, "false")))) {
// migration: HTTP proxy and shared clients default to both
if (!_config.containsKey(OPT_ENCTYPE))
_config.setProperty(OPT_ENCTYPE, "4,0");
}
}
// tell i2ptunnel, who will tell the TunnelTask, who will tell the SocketManager
@ -1011,6 +1019,7 @@ public class TunnelController implements Logging {
* Note that a streamr server is a UI and I2P server but a client on the localhost side.
*
* @since 0.9.17 moved from IndexBean
* @return false if type == null
*/
public static boolean isClient(String type) {
return TYPE_STD_CLIENT.equals(type) ||

View File

@ -748,7 +748,21 @@ public class GeneralHelper {
* @since 0.9.44
*/
public boolean hasEncType(int tunnel, int encType) {
String senc = getProperty(tunnel, "i2cp.leaseSetEncType", "0");
TunnelController tun = getController(tunnel);
if (tun == null) {
// New clients and servers default to both
return encType == 4 || encType == 0;
}
// migration: HTTP proxy and shared clients default to both
String dflt;
if (tun.isClient() &&
(TunnelController.TYPE_HTTP_CLIENT.equals(tun.getType()) ||
Boolean.parseBoolean(tun.getSharedClient()))) {
dflt = "4,0";
} else {
dflt = "0";
}
String senc = getProperty(tunnel, "i2cp.leaseSetEncType", dflt);
String[] senca = DataHelper.split(senc, ",");
String se = Integer.toString(encType);
for (int i = 0; i < senca.length; i++) {

View File

@ -844,7 +844,13 @@ public class TunnelConfig {
// As of 0.9.18, add persistent leaseset keys if not present
// but only if we know the sigtype
String senc = config.getProperty(OPT + "i2cp.leaseSetEncType", "0");
// TODO: Put server enctype migration here
String dflt;
//if (...)
// 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")) {
// only for LS1

View File

@ -1,5 +1,11 @@
2020-07-22 zzz
* i2ptunnel:
- Change default encType to both for new tunnels, http client,
shared clients, and all tunnels for new installs (ticket #2751)
- Change IRC tunnel sigType to EdDSA for new installs (ticket #2749)
2020-07-19 zzz
* i2psnark: Increase max pipeline, negotiate actual value
* i2psnark: Increase max pipeline, negotiate actual value (ticket #2280)
2020-07-11 zzz
* NTCP: Atomics for NTCP final state (ticket #2701)

View File

@ -26,6 +26,7 @@ tunnel.0.i2cpHost=127.0.0.1
tunnel.0.i2cpPort=7654
tunnel.0.option.inbound.nickname=shared clients
tunnel.0.option.outbound.nickname=shared clients
tunnel.0.option.i2cp.leaseSetEncType=4,0
tunnel.0.option.i2cp.reduceIdleTime=900000
tunnel.0.option.i2cp.reduceOnIdle=true
tunnel.0.option.i2cp.reduceQuantity=1
@ -53,7 +54,8 @@ tunnel.1.option.outbound.nickname=Irc2P
tunnel.1.option.i2cp.closeIdleTime=1200000
tunnel.1.option.i2cp.closeOnIdle=true
tunnel.1.option.i2cp.delayOpen=true
tunnel.1.option.i2cp.destination.sigType=ECDSA_SHA256_P256
tunnel.1.option.i2cp.destination.sigType=7
tunnel.1.option.i2cp.leaseSetEncType=4,0
tunnel.1.option.i2cp.newDestOnResume=false
tunnel.1.option.i2cp.reduceIdleTime=600000
tunnel.1.option.i2cp.reduceOnIdle=true
@ -79,6 +81,7 @@ tunnel.2.i2cpHost=127.0.0.1
tunnel.2.i2cpPort=7654
tunnel.2.option.inbound.nickname=shared clients
tunnel.2.option.outbound.nickname=shared clients
tunnel.2.option.i2cp.leaseSetEncType=4,0
tunnel.2.option.i2cp.reduceIdleTime=900000
tunnel.2.option.i2cp.reduceOnIdle=true
tunnel.2.option.i2cp.reduceQuantity=1
@ -101,6 +104,7 @@ tunnel.3.i2cpPort=7654
tunnel.3.option.inbound.nickname=eepsite
tunnel.3.option.outbound.nickname=eepsite
tunnel.3.option.i2cp.destination.sigType=7
tunnel.3.option.i2cp.leaseSetEncType=4,0
tunnel.3.option.inbound.length=3
tunnel.3.option.inbound.lengthVariance=0
tunnel.3.option.outbound.length=3
@ -118,6 +122,7 @@ tunnel.4.listenPort=7659
tunnel.4.name=smtp.postman.i2p
tunnel.4.option.inbound.nickname=shared clients
tunnel.4.option.outbound.nickname=shared clients
tunnel.4.option.i2cp.leaseSetEncType=4,0
tunnel.4.option.i2cp.reduceIdleTime=900000
tunnel.4.option.i2cp.reduceOnIdle=true
tunnel.4.option.i2cp.reduceQuantity=1
@ -139,6 +144,7 @@ tunnel.5.interface=127.0.0.1
tunnel.5.listenPort=7660
tunnel.5.option.inbound.nickname=shared clients
tunnel.5.option.outbound.nickname=shared clients
tunnel.5.option.i2cp.leaseSetEncType=4,0
tunnel.5.option.i2cp.reduceIdleTime=900000
tunnel.5.option.i2cp.reduceOnIdle=true
tunnel.5.option.i2cp.reduceQuantity=1
@ -164,6 +170,7 @@ tunnel.6.i2cpHost=127.0.0.1
tunnel.6.i2cpPort=7654
tunnel.6.option.inbound.nickname=shared clients
tunnel.6.option.outbound.nickname=shared clients
tunnel.6.option.i2cp.leaseSetEncType=4,0
tunnel.6.option.i2cp.reduceIdleTime=900000
tunnel.6.option.i2cp.reduceOnIdle=true
tunnel.6.option.i2cp.reduceQuantity=1

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 8;
public final static long BUILD = 9;
/** for example "-test" */
public final static String EXTRA = "";