Changeset 2ec34f4 for router


Ignore:
Timestamp:
May 22, 2019 5:01:26 PM (11 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3328983
Parents:
7489a64
Message:

I2CP: Set local privkey for encls2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/client/ClientMessageEventListener.java

    r7489a64 r2ec34f4  
    1515import net.i2p.crypto.EncType;
    1616import net.i2p.crypto.SigType;
     17import net.i2p.data.Base64;
    1718import net.i2p.data.DatabaseEntry;
    1819import net.i2p.data.DataHelper;
     
    648649                    encls.setSecret(secret);
    649650                }
     651                // per-client auth
     652                String pk = cfg.getOptions().getProperty("i2cp.leaseSetPrivKey");
     653                if (pk != null) {
     654                    byte[] priv = Base64.decode(pk);
     655                    if (priv == null)
     656                        throw new IllegalArgumentException("bad privkey");
     657                    PrivateKey privkey = new PrivateKey(EncType.ECIES_X25519, priv);
     658                    EncryptedLeaseSet encls = (EncryptedLeaseSet) ls;
     659                    encls.setClientPrivateKey(privkey);
     660                }
    650661            }
    651662            if (_log.shouldDebug())
Note: See TracChangeset for help on using the changeset viewer.