diff --git a/core/java/src/net/i2p/crypto/SU3File.java b/core/java/src/net/i2p/crypto/SU3File.java index f22918273ebd03e275d45bdf3a8542863d28b7b6..21f0cd7bc4b2334b1fa179d3e206abb5a0d197d7 100644 --- a/core/java/src/net/i2p/crypto/SU3File.java +++ b/core/java/src/net/i2p/crypto/SU3File.java @@ -623,22 +623,30 @@ public class SU3File { } else if ("showversion".equals(cmd)) { ok = showVersionCLI(a.get(0)); } else if ("sign".equals(cmd)) { - // speed things up by specifying a small PRNG buffer size - Properties props = new Properties(); - props.setProperty("prng.bufferSize", "16384"); - new I2PAppContext(props); + if (I2PAppContext.getCurrentContext() == null) { + // speed things up by specifying a small PRNG buffer size + Properties props = new Properties(); + props.setProperty("prng.bufferSize", "16384"); + new I2PAppContext(props); + } ok = signCLI(stype, ctype, ftype, a.get(0), a.get(1), a.get(2), a.get(3), a.get(4), "", kspass); } else if ("bulksign".equals(cmd)) { - Properties props = new Properties(); - props.setProperty("prng.bufferSize", "16384"); - new I2PAppContext(props); + if (I2PAppContext.getCurrentContext() == null) { + // speed things up by specifying a small PRNG buffer size + Properties props = new Properties(); + props.setProperty("prng.bufferSize", "16384"); + new I2PAppContext(props); + } ok = bulkSignCLI(stype, ctype, a.get(0), a.get(1), a.get(2), a.get(3), kspass); } else if ("verifysig".equals(cmd)) { ok = verifySigCLI(a.get(0), kfile); } else if ("keygen".equals(cmd)) { - Properties props = new Properties(); - props.setProperty("prng.bufferSize", "16384"); - new I2PAppContext(props); + if (I2PAppContext.getCurrentContext() == null) { + // speed things up by specifying a small PRNG buffer size + Properties props = new Properties(); + props.setProperty("prng.bufferSize", "16384"); + new I2PAppContext(props); + } ok = genKeysCLI(stype, a.get(0), a.get(1), crlfile, a.get(2), kspass); } else if ("extract".equals(cmd)) { String outfile = (a.size() > 1) ? a.get(1) : null;