Changeset 5440a34


Ignore:
Timestamp:
Feb 21, 2019 4:16:27 PM (18 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
9cd90b0
Parents:
9fafc25
Message:

I2CP: Force i2cp.leaseSetType option for offline keys

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/impl/I2CPMessageProducer.java

    r9fafc25 r5440a34  
    121121        CreateSessionMessage msg = new CreateSessionMessage();
    122122        SessionConfig cfg = new SessionConfig(session.getMyDestination());
    123         cfg.setOptions(getRouterOptions(session));
    124         if (session.isOffline()) {
     123        Properties p = getRouterOptions(session);
     124        boolean isOffline = session.isOffline();
     125        if (isOffline) {
     126            if (!p.containsKey(RequestLeaseSetMessageHandler.PROP_LS_TYPE))
     127                p.setProperty(RequestLeaseSetMessageHandler.PROP_LS_TYPE, "3");
     128        }
     129        cfg.setOptions(p);
     130        if (isOffline) {
    125131            cfg.setOfflineSignature(session.getOfflineExpiration(),
    126132                                    session.getTransientSigningPublicKey(),
  • core/java/src/net/i2p/client/impl/RequestLeaseSetMessageHandler.java

    r9fafc25 r5440a34  
    6464    private static final String PROP_LS_SPK = "i2cp.leaseSetSigningPrivateKey";
    6565    // LS 2
    66     private static final String PROP_LS_TYPE = "i2cp.leaseSetType";
     66    public static final String PROP_LS_TYPE = "i2cp.leaseSetType";
    6767    private static final String PROP_LS_ENCTYPE = "i2cp.leaseSetEncType";
    6868
  • router/java/src/net/i2p/router/client/ClientMessageEventListener.java

    r9fafc25 r5440a34  
    290290            }
    291291        }
    292         if ("7".equals(props.getProperty("i2cp.leaseSetType"))) {
     292        String lsType = props.getProperty("i2cp.leaseSetType");
     293        if ("7".equals(lsType)) {
    293294            // Prevent tunnel builds for Meta LS
    294295            // more TODO
     
    297298            props.setProperty("inbound.lengthVariance", "0");
    298299            props.setProperty("outbound.lengthVariance", "0");
     300        } else if (lsType == null && props.getProperty(SessionConfig.PROP_OFFLINE_SIGNATURE) != null) {
     301            // force type 3
     302            props.setProperty("i2cp.leaseSetType", "3");
    299303        }
    300304        cfg.setOptions(props);
Note: See TracChangeset for help on using the changeset viewer.