Changeset 28575db


Ignore:
Timestamp:
Jan 28, 2014 2:21:54 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ec22a1da
Parents:
17e63b0
Message:
  • Key certs:
    • Hide setting in i2ptunnel edit pages unless advanced user
    • Only store LS with key certs to routers that support it
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java

    r17e63b0 r28575db  
    350350    public Set<String> interfaceSet() {
    351351        return Addresses.getAllAddresses();
     352    }
     353
     354    /** @since 0.9.11 */
     355    public boolean isAdvanced() {
     356        return _context.getBooleanProperty("routerconsole.advanced");
    352357    }
    353358
  • apps/i2ptunnel/jsp/editClient.jsp

    r17e63b0 r28575db  
    435435         <% } %>
    436436           
     437         <% if (editBean.isAdvanced()) { %>
    437438            <div id="tunnelOptionsField" class="rowItem">
    438439                <label>
     
    463464                <hr />
    464465            </div>
     466         <% } // isAdvanced %>>
    465467
    466468         <% if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { %>
  • apps/i2ptunnel/jsp/editServer.jsp

    r17e63b0 r28575db  
    537537<% **********************/ %>
    538538
     539         <% if (editBean.isAdvanced()) { %>
    539540            <div id="tunnelOptionsField" class="rowItem">
    540541                <label>
     
    565566                <hr />
    566567            </div>
     568         <% } // isAdvanced %>>
    567569                 
    568570            <div id="customOptionsField" class="rowItem">
  • router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java

    r17e63b0 r28575db  
    1313import java.util.Set;
    1414
     15import net.i2p.data.Certificate;
    1516import net.i2p.data.DatabaseEntry;
    1617import net.i2p.data.Hash;
     18import net.i2p.data.LeaseSet;
    1719import net.i2p.data.RouterInfo;
    1820import net.i2p.data.TunnelId;
     
    164166                        _log.info(getJobId() + ": Error selecting closest hash that wasnt a router! " + peer + " : " + ds);
    165167                    _state.addSkipped(peer);
     168                } else if (_state.getData().getType() == DatabaseEntry.KEY_TYPE_LEASESET &&
     169                           ((LeaseSet)_state.getData()).getDestination().getCertificate().getCertificateType() == Certificate.CERTIFICATE_TYPE_KEY &&
     170                           !supportsKeyCerts((RouterInfo)ds)) {
     171                    if (_log.shouldLog(Log.INFO))
     172                        _log.info(getJobId() + ": Skipping router that doesn't support key certs " + peer + " : " + ds);
     173                    _state.addSkipped(peer);
    166174                } else {
    167175                    int peerTimeout = _facade.getPeerTimeout(peer);
     
    488496    }
    489497
     498    private static final String MIN_KEYCERT_VERSION = "0.9.11";
     499
     500    /**
     501     * Does he support key certs (assumed with a non-DSA key)?
     502     * @since 0.9.11
     503     */
     504    private static boolean supportsKeyCerts(RouterInfo ri) {
     505        String v = ri.getOption("router.version");
     506        if (v == null)
     507            return false;
     508        return VersionComparator.comp(v, MIN_KEYCERT_VERSION) >= 0;
     509    }
     510
    490511    /**
    491512     * Called after sending a dbStore to a peer successfully,
Note: See TracChangeset for help on using the changeset viewer.