forked from I2P_Developers/i2p.i2p
Ratchet: Expire unused tagsets sooner
This commit is contained in:
14
history.txt
14
history.txt
@ -1,3 +1,17 @@
|
|||||||
|
2020-04-06 zzz
|
||||||
|
* Ratchet:
|
||||||
|
- Finish Next Key impl.
|
||||||
|
- Performance improvements and cleanups
|
||||||
|
- Debug page fixes
|
||||||
|
|
||||||
|
2020-04-03 zzz
|
||||||
|
* PrivateKeyFile: Add support for addsubdomain authentication strings
|
||||||
|
|
||||||
|
2020-04-01 zzz
|
||||||
|
* Ratchet:
|
||||||
|
- Next Key WIP
|
||||||
|
- Validate NS datetime block; add NS key bloom filter
|
||||||
|
|
||||||
2020-03-31 zzz
|
2020-03-31 zzz
|
||||||
* NetDB:
|
* NetDB:
|
||||||
- Add support for ratchet replies (proposal 154)
|
- Add support for ratchet replies (proposal 154)
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 5;
|
public final static long BUILD = 6;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
@ -272,12 +272,14 @@ class RatchetTagSet implements TagSetHandle {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For inbound and outbound: Expiration.
|
* For inbound and outbound: Expiration.
|
||||||
* Expiration is getDate() + getTimeout().
|
* Expiration is getDate() + getTimeout() if acked.
|
||||||
|
* May be shorter if not acked.
|
||||||
* @since 0.9.46
|
* @since 0.9.46
|
||||||
*/
|
*/
|
||||||
public synchronized long getExpiration() {
|
public synchronized long getExpiration() {
|
||||||
// TODO return shorter if not acked?
|
if (_acked)
|
||||||
return _date + _timeout;
|
return _date + _timeout;
|
||||||
|
return _created + Math.min(_timeout, RatchetSKM.SESSION_PENDING_DURATION_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** for debugging */
|
/** for debugging */
|
||||||
@ -528,6 +530,9 @@ class RatchetTagSet implements TagSetHandle {
|
|||||||
byte[] key = new byte[32];
|
byte[] key = new byte[32];
|
||||||
hkdf.calculate(_symmkey_ck, _symmkey_constant, INFO_5, _symmkey_ck, key, 0);
|
hkdf.calculate(_symmkey_ck, _symmkey_constant, INFO_5, _symmkey_ck, key, 0);
|
||||||
_lastKey++;
|
_lastKey++;
|
||||||
|
// for outbound, set acked
|
||||||
|
if (_sessionTags == null && _lastKey == 0)
|
||||||
|
_acked = true;
|
||||||
// fill in ID and remoteKey as this may be for inbound
|
// fill in ID and remoteKey as this may be for inbound
|
||||||
return new SessionKeyAndNonce(key, _id, _lastKey, _remoteKey);
|
return new SessionKeyAndNonce(key, _id, _lastKey, _remoteKey);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user