Changeset 040e092
- Timestamp:
- May 29, 2019 7:08:33 PM (20 months ago)
- Branches:
- master
- Children:
- 16ac93c
- Parents:
- 098bde2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2ptunnel/jsp/editServer.jsi
r098bde2 r040e092 524 524 if (!clientAuths.isEmpty()) { 525 525 %> 526 <tr><td><b><%=intl._t("Revoke ?")%> <%=intl._t("Client Name")%></b></td><td><b><%=intl._t("Client Key")%></b></td></tr>526 <tr><td><b><%=intl._t("Revoke")%> <%=intl._t("Client Name")%></b></td><td><b><%=intl._t("Client Key")%></b></td></tr> 527 527 <% 528 528 int i = 0; … … 553 553 } // isEmpty 554 554 %> 555 <tr><td><b><%=intl._t("Add ?")%> <%=intl._t("Client Name")%></b></td><td>555 <tr><td><b><%=intl._t("Add")%> <%=intl._t("Client Name")%></b></td><td> 556 556 <% 557 557 if (dhClient) { -
apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigKeyringHandler.java
r098bde2 r040e092 154 154 } 155 155 if (bdold != null) { 156 // debug157 addFormNotice("already cached: " + bdold);156 if (_log.shouldDebug()) 157 _log.debug("already cached: " + bdold); 158 158 } 159 159 try { -
core/java/src/net/i2p/client/impl/RequestLeaseSetMessageHandler.java
r098bde2 r040e092 131 131 leaseSet = new LeaseSet2(); 132 132 } else if (_ls2Type == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) { 133 EncryptedLeaseSet encls2 = new EncryptedLeaseSet(); 134 String secret = session.getOptions().getProperty(PROP_SECRET); 135 if (secret != null) { 136 secret = DataHelper.getUTF8(Base64.decode(secret)); 137 encls2.setSecret(secret); 138 } 139 leaseSet = encls2; 133 leaseSet = new EncryptedLeaseSet(); 140 134 } else if (_ls2Type == DatabaseEntry.KEY_TYPE_META_LS2) { 141 135 leaseSet = new MetaLeaseSet(); … … 175 169 */ 176 170 protected synchronized void signLeaseSet(LeaseSet leaseSet, boolean isLS2, I2PSessionImpl session) { 171 // must be before setDestination() 172 if (isLS2 && _ls2Type == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) { 173 String secret = session.getOptions().getProperty(PROP_SECRET); 174 if (secret != null) { 175 EncryptedLeaseSet encls2 = (EncryptedLeaseSet) leaseSet; 176 secret = DataHelper.getUTF8(Base64.decode(secret)); 177 encls2.setSecret(secret); 178 } 179 } 177 180 Destination dest = session.getMyDestination(); 178 181 // also, if this session is connected to multiple routers, include other leases here -
core/java/src/net/i2p/client/impl/RequestVariableLeaseSetMessageHandler.java
r098bde2 r040e092 59 59 leaseSet = new LeaseSet(); 60 60 } 61 // Full Meta and Encryptedsupport TODO61 // Full Meta support TODO 62 62 for (int i = 0; i < msg.getEndpoints(); i++) { 63 63 Lease lease; -
core/java/src/net/i2p/crypto/Blinding.java
r098bde2 r040e092 328 328 I2PAppContext ctx = I2PAppContext.getGlobalContext(); 329 329 //String b32 = encode(pub, null); 330 String b32 = encode(pub, "foobarbaz");330 String b32 = encode(pub, true, false); 331 331 System.out.println("pub b32 is " + b32); 332 332 BlindData bd = decode(ctx, b32); -
core/java/src/net/i2p/data/EncryptedLeaseSet.java
r098bde2 r040e092 43 43 private PrivateKey _clientPrivateKey; 44 44 private final Log _log; 45 // debug 46 private int _authType, _numKeys; 45 47 46 48 private static final int MIN_ENCRYPTED_SIZE = 8 + 16; … … 75 77 /** 76 78 * Must be set before sign or verify. 79 * Must be called before setDestination() or setSigningKey(), or alpha will be wrong. 77 80 * 78 81 * @param secret null or "" for none (default) … … 80 83 */ 81 84 public void setSecret(String secret) { 85 if (_signingKey != null && !DataHelper.eq(secret, _secret)) { 86 if (_log.shouldWarn()) 87 _log.warn("setSecret() after setSigningKey()" + 88 " was: " + _secret + " now: " + secret); 89 } 82 90 _secret = secret; 83 91 } … … 129 137 130 138 /** 131 * Overridden to set the blinded key 139 * Overridden to set the blinded key. 140 * setSecret() MUST be called before this for non-null secret, or alpha will be wrong. 132 141 * 133 142 * @param dest non-null, must be EdDSA_SHA512_Ed25519 or RedDSA_SHA512_Ed25519 … … 148 157 149 158 /** 150 * Overridden to set the blinded key 159 * Overridden to set the blinded key. 160 * setSecret() MUST be called before this for non-null secret, or alpha will be wrong. 151 161 * 152 162 * @param spk unblinded key non-null, must be EdDSA_SHA512_Ed25519 or RedDSA_SHA512_Ed25519 … … 157 167 @Override 158 168 public void setSigningKey(SigningPublicKey spk) { 159 // TODO already-set checks160 169 SigType type = spk.getType(); 161 170 if (type != SigType.EdDSA_SHA512_Ed25519 && … … 193 202 _log.debug("Blind:" + 194 203 "\norig: " + spk + 204 "\nsecret: " + _secret + 195 205 "\nalpha: " + _alpha + 196 206 "\nblinded: " + rv); … … 416 426 byte[] iv = new byte[32]; 417 427 int authLen; 428 _authType = authType; // debug 418 429 if (authType == BlindData.AUTH_NONE) { 419 430 authLen = 1; … … 422 433 if (clientKeys == null || clientKeys.isEmpty()) 423 434 throw new IllegalArgumentException("No client keys provided"); 435 _numKeys = clientKeys.size(); // debug 424 436 authLen = 1 + SALT_LEN + 2 + (clientKeys.size() * CLIENT_LEN); 425 437 } else { … … 610 622 611 623 int authType = plaintext[0] & 0x0f; 624 _authType = authType; // debug 612 625 int authLen; 613 626 if (authType == BlindData.AUTH_NONE) { … … 623 636 System.arraycopy(plaintext, 1, seed, 0, 32); 624 637 int count = (int) DataHelper.fromLong(plaintext, 33, 2); 638 _numKeys = count; // debug 625 639 if (count == 0) 626 640 throw new DataFormatException("No client entries"); … … 949 963 buf.append("\n\tPublished: ").append(new java.util.Date(_published)); 950 964 buf.append("\n\tExpires: ").append(new java.util.Date(_expires)); 965 buf.append("\n\tAuth Type: ").append(_authType); 966 buf.append("\n\tClient Keys: ").append(_numKeys); 951 967 if (_decryptedLS2 != null) { 968 if (_secret != null) 969 buf.append("\n\tSecret: ").append(_secret); 970 if (_clientPrivateKey != null) 971 buf.append("\n\tClient Private Key: ").append(_clientPrivateKey.toBase64()); 952 972 buf.append("\n\tDecrypted LS:\n").append(_decryptedLS2); 953 973 } else if (_destination != null) { -
history.txt
r098bde2 r040e092 1 2019-05-29 zzz 2 * I2CP: Fix bugs with lookup password 3 * Util: Store save time in config files 4 5 2019-05-28 zzz 6 * Console: Form handling on /configkeyring for LS2 7 8 2019-05-27 zzz 9 * Console: Start rework of /configkeyring for LS2 10 11 2019-05-26 zzz 12 * I2CP: Add per-client auth to generated leaseset 13 1 14 2019-05-24 zzz 2 15 * i2ptunnel: -
router/java/src/net/i2p/router/RouterVersion.java
r098bde2 r040e092 19 19 public final static String ID = "Monotone"; 20 20 public final static String VERSION = CoreVersion.VERSION; 21 public final static long BUILD = 6;21 public final static long BUILD = 7; 22 22 23 23 /** for example "-test" */ -
router/java/src/net/i2p/router/client/ClientMessageEventListener.java
r098bde2 r040e092 552 552 if (type == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) { 553 553 // so we can decrypt it 554 // secret must be set before destination 555 String secret = cfg.getOptions().getProperty("i2cp.leaseSetSecret"); 556 if (secret != null) { 557 EncryptedLeaseSet encls = (EncryptedLeaseSet) ls; 558 secret = DataHelper.getUTF8(Base64.decode(secret)); 559 encls.setSecret(secret); 560 } 554 561 try { 555 562 ls.setDestination(dest); … … 653 660 return; 654 661 } 655 String secret = cfg.getOptions().getProperty("i2cp.leaseSetSecret");656 if (secret != null) {657 EncryptedLeaseSet encls = (EncryptedLeaseSet) ls;658 secret = DataHelper.getUTF8(Base64.decode(secret));659 encls.setSecret(secret);660 }661 662 } 662 663 if (_log.shouldDebug()) -
router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
r098bde2 r040e092 947 947 _log.warn("Found blind data for encls: " + bd); 948 948 encls = (EncryptedLeaseSet) leaseSet; 949 // secret must be set before destination 950 String secret = bd.getSecret(); 951 if (secret != null) 952 encls.setSecret(secret); 949 953 Destination dest = bd.getDestination(); 950 954 if (dest != null) { … … 953 957 encls.setSigningKey(bd.getUnblindedPubKey()); 954 958 } 955 // secret956 String secret = bd.getSecret();957 if (secret != null)958 encls.setSecret(secret);959 959 // per-client auth 960 960 if (bd.getAuthType() != BlindData.AUTH_NONE)
Note: See TracChangeset
for help on using the changeset viewer.