Changeset 55a6f44


Ignore:
Timestamp:
Oct 11, 2015 3:39:28 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2c03b43
Parents:
971a265
Message:

Crypto: Test for broken Gentoo ECDSA support
Add SystemVersion?.isJava9()

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/SigType.java

    r971a265 r55a6f44  
    1212import net.i2p.crypto.eddsa.spec.EdDSANamedCurveTable;
    1313import net.i2p.data.Hash;
     14import net.i2p.data.SigningPrivateKey;
    1415import net.i2p.data.SimpleDataStructure;
     16import net.i2p.util.SystemVersion;
    1517
    1618/**
     
    194196        try {
    195197            getParams();
    196             if (getBaseAlgorithm() != SigAlgo.EdDSA)
    197                 Signature.getInstance(getAlgorithmName());
     198            if (getBaseAlgorithm() != SigAlgo.EdDSA) {
     199                Signature jsig = Signature.getInstance(getAlgorithmName());
     200                if (getBaseAlgorithm() == SigAlgo.EC && SystemVersion.isGentoo() ) {
     201                    // Do a full keygen/sign test on Gentoo, because it lies. Keygen works but sigs fail.
     202                    // https://bugs.gentoo.org/show_bug.cgi?id=528338
     203                    // http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2497
     204                    // http://zzz.i2p/topics/1931
     205                    // Be sure nothing in the code paths below calls isAvailable()
     206                    // get an I2P keypair
     207                    SimpleDataStructure[] keys = KeyGenerator.getInstance().generateSigningKeys(this);
     208                    SigningPrivateKey privKey = (SigningPrivateKey) keys[1];
     209                    // convert privkey back to Java key and sign
     210                    jsig.initSign(SigUtil.toJavaECKey(privKey));
     211                    // use the pubkey as random data
     212                    jsig.update(keys[0].getData());
     213                    jsig.sign();
     214                }
     215            }
    198216            getDigestInstance();
    199217            getHashInstance();
  • core/java/src/net/i2p/util/SystemVersion.java

    r971a265 r55a6f44  
    1919    private static final boolean _isX86 = System.getProperty("os.arch").contains("86") ||
    2020                                          System.getProperty("os.arch").equals("amd64");
     21    private static final boolean _isGentoo = System.getProperty("os.version").contains("gentoo") ||
     22                                             System.getProperty("os.version").contains("hardened");  // Funtoo
    2123    private static final boolean _isAndroid;
    2224    private static final boolean _isApache;
     
    2830    private static final boolean _oneDotSeven;
    2931    private static final boolean _oneDotEight;
     32    private static final boolean _oneDotNine;
    3033    private static final int _androidSDK;
    3134
     
    6366            _oneDotSeven = _androidSDK >= 19;
    6467            _oneDotEight = false;
     68            _oneDotNine = false;
    6569        } else {
    6670            _oneDotSix = VersionComparator.comp(System.getProperty("java.version"), "1.6") >= 0;
    6771            _oneDotSeven = _oneDotSix && VersionComparator.comp(System.getProperty("java.version"), "1.7") >= 0;
    6872            _oneDotEight = _oneDotSeven && VersionComparator.comp(System.getProperty("java.version"), "1.8") >= 0;
     73            _oneDotNine = _oneDotEight && VersionComparator.comp(System.getProperty("java.version"), "1.9") >= 0;
    6974        }
    7075    }
     
    97102
    98103    /**
     104     *  @since 0.9.23
     105     */
     106    public static boolean isGentoo() {
     107        return _isGentoo;
     108    }
     109
     110    /**
    99111     *  @since 0.9.8
    100112     */
     
    138150    public static boolean isJava8() {
    139151        return _oneDotEight;
     152    }
     153
     154    /**
     155     *
     156     *  @return true if Java 1.9 or higher, false for Android.
     157     *  @since 0.9.23
     158     */
     159    public static boolean isJava9() {
     160        return _oneDotNine;
    140161    }
    141162
  • history.txt

    r971a265 r55a6f44  
     12015-10-11 zzz
     2 * Crypto: Test for broken Gentoo ECDSA support
     3
    142015-10-10 zzz
    25 * i2psnark: Increase max piece size to 16 MB, max files to 999,
     
    47 * JobQueue: Only adjust timing for negative clock shifts
    58 * NamingServices: Add support for lookups prefixed with "www."
     9 * Startup: Increase rekey probability
    610
    7112015-10-08 zzz
  • router/java/src/net/i2p/router/RouterVersion.java

    r971a265 r55a6f44  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 16;
     21    public final static long BUILD = 17;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.