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

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

* Reseed: Check su3 version as date code

parent 4e463d57
No related branches found
No related tags found
No related merge requests found
......@@ -479,6 +479,17 @@ public class Reseeder {
int type = su3.getContentType();
if (type != SU3File.CONTENT_RESEED)
throw new IOException("Bad content type " + type);
String version = su3.getVersionString();
try {
Long ver = Long.parseLong(version.trim());
if (ver >= 1400000000L) {
// preliminary code was using "3"
// new format is date +%s
ver *= 1000;
if (ver < _context.clock().now() - MAX_FILE_AGE)
throw new IOException("su3 file too old");
}
} catch (NumberFormatException nfe) {}
tmpDir = new File(_context.getTempDir(), "reseeds-" + _context.random().nextInt());
if (!FileUtil.extractZip(zip, tmpDir))
throw new IOException("Bad zip file");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment