forked from I2P_Developers/i2p.i2p
Tunnels: Improved logging and handling of offline signature expiration
Store back ref to controller in tunnel Stop server controller on I2PException Support generation of keys with fractional days expiration for testing
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.I2PSession;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.data.SessionKey;
|
||||
import net.i2p.data.SessionTag;
|
||||
@@ -235,6 +236,10 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
|
||||
* @since 0.9.20 moved from Packet
|
||||
*/
|
||||
public int writeSignedPacket(byte buffer[], int offset) throws IllegalStateException {
|
||||
if (isFlagSet(FLAG_SIGNATURE_OFFLINE)) {
|
||||
if (_transientExpires < _context.clock().now())
|
||||
throw new IllegalStateException("Offline signature expired " + DataHelper.formatTime(_transientExpires));
|
||||
}
|
||||
setFlag(FLAG_SIGNATURE_INCLUDED);
|
||||
SigningPrivateKey key = _session.getPrivateKey();
|
||||
int size = writePacket(buffer, offset, key.getType().getSigLen());
|
||||
|
||||
Reference in New Issue
Block a user