I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit a0822a6b authored by zzz's avatar zzz
Browse files

NTCP2: Reduce min downtime for rekeying if hidden

parent 15da2f85
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,7 @@ public class NTCPTransport extends TransportImpl {
private static final int NTCP2_IV_LEN = OutboundNTCP2State.IV_SIZE;
private static final int NTCP2_KEY_LEN = OutboundNTCP2State.KEY_SIZE;
private static final long MIN_DOWNTIME_TO_REKEY = 30*24*60*60*1000L;
private static final long MIN_DOWNTIME_TO_REKEY_HIDDEN = 24*60*60*1000L;
private final boolean _enableNTCP1;
private final boolean _enableNTCP2;
private final byte[] _ntcp2StaticPubkey;
......@@ -252,7 +253,8 @@ public class NTCPTransport extends TransportImpl {
String b64IV = null;
String s = null;
// try to determine if we've been down for 30 days or more
boolean shouldRekey = _context.getEstimatedDowntime() >= MIN_DOWNTIME_TO_REKEY;
long minDowntime = _context.router().isHidden() ? MIN_DOWNTIME_TO_REKEY_HIDDEN : MIN_DOWNTIME_TO_REKEY;
boolean shouldRekey = _context.getEstimatedDowntime() >= minDowntime;
if (!shouldRekey) {
s = ctx.getProperty(PROP_NTCP2_SP);
if (s != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment