diff --git a/core/java/src/net/i2p/crypto/DSAEngine.java b/core/java/src/net/i2p/crypto/DSAEngine.java index 941774253ca91a774199e3eef09194f412362142..d09d58ce16f7f6e15dfad91023d00a4c1eeb8493 100644 --- a/core/java/src/net/i2p/crypto/DSAEngine.java +++ b/core/java/src/net/i2p/crypto/DSAEngine.java @@ -38,12 +38,13 @@ import net.i2p.data.Hash; import net.i2p.data.Signature; import net.i2p.data.SigningPrivateKey; import net.i2p.data.SigningPublicKey; +import net.i2p.data.SimpleDataStructure; import net.i2p.util.Log; import net.i2p.util.NativeBigInteger; /** * Params and rv's changed from Hash to SHA1Hash for version 0.8.1 - * There shouldn't be any external users of those variants. + * Hash variants of sign() and verifySignature() restored in 0.8.3, required by Syndie. */ public class DSAEngine { private Log _log; @@ -68,6 +69,22 @@ public class DSAEngine { /** @param hash SHA-1 hash, NOT a SHA-256 hash */ public boolean verifySignature(Signature signature, SHA1Hash hash, SigningPublicKey verifyingKey) { + return verifySig(signature, hash, verifyingKey); + } + + /** + * Used by Syndie. + * @since 0.8.3 (restored, was removed in 0.8.1 and 0.8.2) + */ + public boolean verifySignature(Signature signature, Hash hash, SigningPublicKey verifyingKey) { + return verifySig(signature, hash, verifyingKey); + } + + /** + * @param hash either a Hash or a SHA1Hash + * @since 0.8.3 + */ + private boolean verifySig(Signature signature, SimpleDataStructure hash, SigningPublicKey verifyingKey) { long start = _context.clock().now(); try { @@ -129,6 +146,22 @@ public class DSAEngine { /** @param hash SHA-1 hash, NOT a SHA-256 hash */ public Signature sign(SHA1Hash hash, SigningPrivateKey signingKey) { + return signIt(hash, signingKey); + } + + /** + * Used by Syndie. + * @since 0.8.3 (restored, was removed in 0.8.1 and 0.8.2) + */ + public Signature sign(Hash hash, SigningPrivateKey signingKey) { + return signIt(hash, signingKey); + } + + /** + * @param hash either a Hash or a SHA1Hash + * @since 0.8.3 + */ + private Signature signIt(SimpleDataStructure hash, SigningPrivateKey signingKey) { if ((signingKey == null) || (hash == null)) return null; long start = _context.clock().now(); diff --git a/history.txt b/history.txt index 7f59ca67d6661f213e6c0ef397a73912d9e1d279..81b496b5899765399184c49aca6f66e03dd1383a 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,7 @@ 2010-12-29 zzz * Console: Add 500 error page + * DSAEngine: Restore variants of methods using a Hash argument, + required by Syndie, removed in 0.8.1 * Reseed: - Add new configreseed page - Add StartCom CA cert required for www.i2pbote.net diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 0725033fa600cfb5180ac82283f5194ee35b34b0..f6e6df3a5c0d10fbf1efc2f7069c342c2fe16f4e 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 3; + public final static long BUILD = 4; /** for example "-test" */ public final static String EXTRA = "";