I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 5440a340 authored by zzz's avatar zzz
Browse files

I2CP: Force i2cp.leaseSetType option for offline keys

parent 9fafc253
No related branches found
No related tags found
No related merge requests found
...@@ -120,8 +120,14 @@ class I2CPMessageProducer { ...@@ -120,8 +120,14 @@ class I2CPMessageProducer {
updateBandwidth(session); updateBandwidth(session);
CreateSessionMessage msg = new CreateSessionMessage(); CreateSessionMessage msg = new CreateSessionMessage();
SessionConfig cfg = new SessionConfig(session.getMyDestination()); SessionConfig cfg = new SessionConfig(session.getMyDestination());
cfg.setOptions(getRouterOptions(session)); Properties p = getRouterOptions(session);
if (session.isOffline()) { 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(), cfg.setOfflineSignature(session.getOfflineExpiration(),
session.getTransientSigningPublicKey(), session.getTransientSigningPublicKey(),
session.getOfflineSignature()); session.getOfflineSignature());
......
...@@ -63,7 +63,7 @@ class RequestLeaseSetMessageHandler extends HandlerImpl { ...@@ -63,7 +63,7 @@ class RequestLeaseSetMessageHandler extends HandlerImpl {
private static final String PROP_LS_PK = "i2cp.leaseSetPrivateKey"; private static final String PROP_LS_PK = "i2cp.leaseSetPrivateKey";
private static final String PROP_LS_SPK = "i2cp.leaseSetSigningPrivateKey"; private static final String PROP_LS_SPK = "i2cp.leaseSetSigningPrivateKey";
// LS 2 // 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"; private static final String PROP_LS_ENCTYPE = "i2cp.leaseSetEncType";
public RequestLeaseSetMessageHandler(I2PAppContext context) { public RequestLeaseSetMessageHandler(I2PAppContext context) {
......
...@@ -289,13 +289,17 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi ...@@ -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 // Prevent tunnel builds for Meta LS
// more TODO // more TODO
props.setProperty("inbound.length", "0"); props.setProperty("inbound.length", "0");
props.setProperty("outbound.length", "0"); props.setProperty("outbound.length", "0");
props.setProperty("inbound.lengthVariance", "0"); props.setProperty("inbound.lengthVariance", "0");
props.setProperty("outbound.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); cfg.setOptions(props);
// this sets the session id // this sets the session id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment