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

Skip to content
Snippets Groups Projects
Commit 5c3e8157 authored by jrandom's avatar jrandom Committed by zzz
Browse files

dummy DSA (for sim - dont run on live net)

parent 55e780d8
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import net.i2p.client.naming.NamingService;
import net.i2p.crypto.AESEngine;
import net.i2p.crypto.CryptixAESEngine;
import net.i2p.crypto.DSAEngine;
import net.i2p.crypto.DummyDSAEngine;
import net.i2p.crypto.DummyElGamalEngine;
import net.i2p.crypto.ElGamalAESEngine;
import net.i2p.crypto.ElGamalEngine;
......@@ -373,8 +374,12 @@ public class I2PAppContext {
}
private void initializeDSA() {
synchronized (this) {
if (_dsa == null)
_dsa = new DSAEngine(this);
if (_dsa == null) {
if ("off".equals(getProperty("i2p.encryption", "on")))
_dsa = new DummyDSAEngine(this);
else
_dsa = new DSAEngine(this);
}
_dsaInitialized = true;
}
}
......
package net.i2p.crypto;
import net.i2p.I2PAppContext;
import net.i2p.data.Hash;
import net.i2p.data.Signature;
import net.i2p.data.SigningPrivateKey;
import net.i2p.data.SigningPublicKey;
import net.i2p.util.Log;
import net.i2p.util.NativeBigInteger;
/**
* Stub that offers no authentication.
*
*/
public class DummyDSAEngine extends DSAEngine {
public DummyDSAEngine(I2PAppContext context) {
super(context);
}
public boolean verifySignature(Signature signature, byte signedData[], SigningPublicKey verifyingKey) {
return true;
}
public Signature sign(byte data[], SigningPrivateKey signingKey) {
Signature sig = new Signature();
sig.setData(Signature.FAKE_SIGNATURE);
return sig;
}
}
\ No newline at end of file
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