Changes in / [f1f97e8:d868f7c0]


Ignore:
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/I2PAppContext.java

    rf1f97e8 rd868f7c0  
    389389     * data.  This component allows transparent operation of the
    390390     * ElGamal/AES+SessionTag algorithm, and contains all of the session tags
    391      * for one particular application.  If you want to seperate multiple apps
    392      * to have their own sessionTags and sessionKeys, they should use different
    393      * I2PAppContexts, and hence, different sessionKeyManagers.
     391     * for one particular application.
     392     *
     393     * This is deprecated for client use, it should be used only by the router
     394     * as its own key manager. Not that clients are doing end-to-end crypto anyway.
     395     *
     396     * For client crypto within the router,
     397     * use RouterContext.clientManager.getClientSessionKeyManager(dest)
    394398     *
    395399     */
  • core/java/src/net/i2p/crypto/ElGamalAESEngine.java

    rf1f97e8 rd868f7c0  
    6060
    6161    /**
    62      * Decrypt the message using the given private key using tags from the given key manager.
     62     * Decrypt the message using the given private key using tags from the default key manager.
     63     *
     64     * @deprecated specify the key manager!
    6365     */
    6466    public byte[] decrypt(byte data[], PrivateKey targetPrivateKey) throws DataFormatException {
     
    6769
    6870    /**
    69      * Decrypt the message using the given private key.  This works according to the
     71     * Decrypt the message using the given private key
     72     * and using tags from the specified key manager.
     73     * This works according to the
    7074     * ElGamal+AES algorithm in the data structure spec.
    7175     *
  • core/java/src/net/i2p/data/SessionKey.java

    rf1f97e8 rd868f7c0  
    9090    @Override
    9191    public String toString() {
     92        return "SessionKey " + toBase64();
     93      /****
    9294        if (true) return super.toString();
    9395        StringBuilder buf = new StringBuilder(64);
     
    104106        buf.append("]");
    105107        return buf.toString();
     108      ****/
    106109    }
    107110}
  • core/java/src/net/i2p/data/SessionTag.java

    rf1f97e8 rd868f7c0  
    5959    }
    6060
     61    @Override
     62    public String toString() {
     63        return "SessionTag " + toBase64();
     64    }
    6165}
  • router/java/src/net/i2p/router/client/ClientConnectionRunner.java

    rf1f97e8 rd868f7c0  
    1919
    2020import net.i2p.crypto.SessionKeyManager;
     21import net.i2p.crypto.TransientSessionKeyManager;
    2122import net.i2p.data.Destination;
    2223import net.i2p.data.Hash;
     
    189190            _log.debug("SessionEstablished called for destination " + _destHashCache.toBase64());
    190191        _config = config;
    191         // per-dest unimplemented
    192         //if (_sessionKeyManager == null)
    193         //    _sessionKeyManager = new TransientSessionKeyManager(_context);
    194         //else
    195         //    _log.error("SessionEstablished called for twice for destination " + _destHashCache.toBase64().substring(0,4));
     192        // per-destination session key manager to prevent rather easy correlation
     193        if (_sessionKeyManager == null)
     194            _sessionKeyManager = new TransientSessionKeyManager(_context);
     195        else
     196            _log.error("SessionEstablished called for twice for destination " + _destHashCache.toBase64().substring(0,4));
    196197        _manager.destinationEstablished(this);
    197198    }
  • router/java/src/net/i2p/router/tunnel/pool/TestJob.java

    rf1f97e8 rd868f7c0  
    2929    private TunnelInfo _replyTunnel;
    3030    private PooledTunnelCreatorConfig _otherTunnel;
     31    /** save this so we can tell the SKM to kill it if the test fails */
     32    private SessionTag _encryptTag;
    3133   
    3234    /** base to randomize the test delay on */
     
    129131
    130132        SessionKey encryptKey = getContext().keyGenerator().generateSessionKey();
    131         SessionTag encryptTag = new SessionTag(true);
     133        _encryptTag = new SessionTag(true);
    132134        SessionKey sentKey = new SessionKey();
    133135        Set sentTags = null;
    134136        GarlicMessage msg = GarlicMessageBuilder.buildMessage(getContext(), payload, sentKey, sentTags,
    135137                                                              getContext().keyManager().getPublicKey(),
    136                                                               encryptKey, encryptTag);
     138                                                              encryptKey, _encryptTag);
    137139
    138140        if (msg == null) {
     
    142144        }
    143145        Set encryptTags = new HashSet(1);
    144         encryptTags.add(encryptTag);
     146        encryptTags.add(_encryptTag);
     147        // Register the single tag with the SKM
    145148        getContext().sessionKeyManager().tagsReceived(encryptKey, encryptTags);
    146149
     
    308311            if (_log.shouldLog(Log.WARN))
    309312                _log.warn("Timeout: found? " + _found, getAddedBy());
    310             if (!_found)
     313            if (!_found) {
     314                // don't clog up the SKM with old one-tag tagsets
     315                getContext().sessionKeyManager().consumeTag(_encryptTag);
    311316                testFailed(getContext().clock().now() - _started);
     317            }
    312318        }
    313319       
Note: See TracChangeset for help on using the changeset viewer.