Changeset 8d891b99


Ignore:
Timestamp:
Jan 20, 2009 5:12:24 PM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0e2a422
Parents:
807f0665
Message:
  • Router: Add a keyring for decrypting leases
  • Routerconsole: Add configkeyring.jsp
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/jsp/confignav.jsp

    r807f0665 r8d891b99  
    1111 if (request.getRequestURI().indexOf("configpeer.jsp") != -1) {
    1212 %>Peers | <% } else { %><a href="configpeer.jsp">Peers</a> | <% }
     13 if (request.getRequestURI().indexOf("configkeyring.jsp") != -1) {
     14 %>Keyring | <% } else { %><a href="configkeyring.jsp">Keyring</a> | <% }
    1315 if (request.getRequestURI().indexOf("configlogging.jsp") != -1) {
    1416 %>Logging | <% } else { %><a href="configlogging.jsp">Logging</a> | <% }
  • core/java/src/net/i2p/I2PAppContext.java

    r807f0665 r8d891b99  
    2525import net.i2p.util.Clock;
    2626import net.i2p.util.FortunaRandomSource;
     27import net.i2p.util.KeyRing;
    2728import net.i2p.util.LogManager;
    2829import net.i2p.util.PooledRandomSource;
     
    7677    private RandomSource _random;
    7778    private KeyGenerator _keyGenerator;
     79    protected KeyRing _keyRing; // overridden in RouterContext
    7880    private volatile boolean _statManagerInitialized;
    7981    private volatile boolean _sessionKeyManagerInitialized;
     
    9294    private volatile boolean _randomInitialized;
    9395    private volatile boolean _keyGeneratorInitialized;
     96    protected volatile boolean _keyRingInitialized; // used in RouterContext
    9497   
    9598   
     
    142145        _elGamalAESEngine = null;
    143146        _logManager = null;
     147        _keyRing = null;
    144148        _statManagerInitialized = false;
    145149        _sessionKeyManagerInitialized = false;
     
    148152        _elGamalAESEngineInitialized = false;
    149153        _logManagerInitialized = false;
     154        _keyRingInitialized = false;
    150155    }
    151156   
     
    510515                _routingKeyGenerator = new RoutingKeyGenerator(this);
    511516            _routingKeyGeneratorInitialized = true;
     517        }
     518    }
     519   
     520    /**
     521     * Basic hash map
     522     */
     523    public KeyRing keyRing() {
     524        if (!_keyRingInitialized)
     525            initializeKeyRing();
     526        return _keyRing;
     527    }
     528
     529    protected void initializeKeyRing() {
     530        synchronized (this) {
     531            if (_keyRing == null)
     532                _keyRing = new KeyRing();
     533            _keyRingInitialized = true;
    512534        }
    513535    }
  • router/java/src/net/i2p/router/RouterContext.java

    r807f0665 r8d891b99  
    2727import net.i2p.router.tunnel.pool.TunnelPoolManager;
    2828import net.i2p.util.Clock;
     29import net.i2p.util.KeyRing;
    2930
    3031/**
     
    367368    }
    368369
     370    /** override to support storage in router.config */
     371    @Override
     372    public KeyRing keyRing() {
     373        if (!_keyRingInitialized)
     374            initializeKeyRing();
     375        return _keyRing;
     376    }
     377
     378    @Override
     379    protected void initializeKeyRing() {
     380        synchronized (this) {
     381            if (_keyRing == null)
     382                _keyRing = new PersistentKeyRing(this);
     383            _keyRingInitialized = true;
     384        }
     385    }
     386   
    369387}
Note: See TracChangeset for help on using the changeset viewer.