forked from I2P_Developers/i2p.i2p
I2CP: Force i2cp.leaseSetType option for offline keys
This commit is contained in:
@@ -120,8 +120,14 @@ class I2CPMessageProducer {
|
||||
updateBandwidth(session);
|
||||
CreateSessionMessage msg = new CreateSessionMessage();
|
||||
SessionConfig cfg = new SessionConfig(session.getMyDestination());
|
||||
cfg.setOptions(getRouterOptions(session));
|
||||
if (session.isOffline()) {
|
||||
Properties p = getRouterOptions(session);
|
||||
boolean isOffline = session.isOffline();
|
||||
if (isOffline) {
|
||||
if (!p.containsKey(RequestLeaseSetMessageHandler.PROP_LS_TYPE))
|
||||
p.setProperty(RequestLeaseSetMessageHandler.PROP_LS_TYPE, "3");
|
||||
}
|
||||
cfg.setOptions(p);
|
||||
if (isOffline) {
|
||||
cfg.setOfflineSignature(session.getOfflineExpiration(),
|
||||
session.getTransientSigningPublicKey(),
|
||||
session.getOfflineSignature());
|
||||
|
||||
@@ -63,7 +63,7 @@ class RequestLeaseSetMessageHandler extends HandlerImpl {
|
||||
private static final String PROP_LS_PK = "i2cp.leaseSetPrivateKey";
|
||||
private static final String PROP_LS_SPK = "i2cp.leaseSetSigningPrivateKey";
|
||||
// LS 2
|
||||
private static final String PROP_LS_TYPE = "i2cp.leaseSetType";
|
||||
public static final String PROP_LS_TYPE = "i2cp.leaseSetType";
|
||||
private static final String PROP_LS_ENCTYPE = "i2cp.leaseSetEncType";
|
||||
|
||||
public RequestLeaseSetMessageHandler(I2PAppContext context) {
|
||||
|
||||
@@ -289,13 +289,17 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("7".equals(props.getProperty("i2cp.leaseSetType"))) {
|
||||
String lsType = props.getProperty("i2cp.leaseSetType");
|
||||
if ("7".equals(lsType)) {
|
||||
// Prevent tunnel builds for Meta LS
|
||||
// more TODO
|
||||
props.setProperty("inbound.length", "0");
|
||||
props.setProperty("outbound.length", "0");
|
||||
props.setProperty("inbound.lengthVariance", "0");
|
||||
props.setProperty("outbound.lengthVariance", "0");
|
||||
} else if (lsType == null && props.getProperty(SessionConfig.PROP_OFFLINE_SIGNATURE) != null) {
|
||||
// force type 3
|
||||
props.setProperty("i2cp.leaseSetType", "3");
|
||||
}
|
||||
cfg.setOptions(props);
|
||||
// this sets the session id
|
||||
|
||||
Reference in New Issue
Block a user