Changeset b559b41


Ignore:
Timestamp:
Nov 8, 2016 2:09:56 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e614b099
Parents:
cd775fa
Message:

Crypto: Change serial number in selfsigned certs from int to long
Add CertUtil? to command line

Location:
core/java/src/net/i2p
Files:
3 edited

Legend:

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

    rcd775fa rb559b41  
    536536
    537537
    538 
    539 /****
    540538    public static final void main(String[] args) {
    541539        if (args.length < 2) {
     
    546544            File f = new File(args[1]);
    547545            if (args[0].equals("loadcert")) {
    548                 loadCert(f);
     546                X509Certificate cert = loadCert(f);
     547                System.out.println(net.i2p.util.HexDump.dump(cert.getEncoded()));
    549548            } else if (args[0].equals("loadcrl")) {
    550549                loadCRL(f);
     
    570569        }
    571570    }
    572 ****/
    573571}
  • core/java/src/net/i2p/crypto/SelfSignedGenerator.java

    rcd775fa rb559b41  
    265265        byte[] version = { (byte) 0xa0, 3, 2, 1, 2 };
    266266
    267         // postive serial number (int)
    268         byte[] serial = new byte[6];
     267        // positive serial number (long)
     268        byte[] serial = new byte[10];
    269269        serial[0] = 2;
    270         serial[1] = 4;
    271         RandomSource.getInstance().nextBytes(serial, 2, 4);
     270        serial[1] = 8;
     271        RandomSource.getInstance().nextBytes(serial, 2, 8);
    272272        serial[2] &= 0x7f;
    273273
  • core/java/src/net/i2p/util/CommandLine.java

    rcd775fa rb559b41  
    2323        "net.i2p.CoreVersion",
    2424        "net.i2p.client.naming.BlockfileNamingService",
     25        "net.i2p.crypto.CertUtil",
    2526        "net.i2p.crypto.CryptoCheck",
    2627        "net.i2p.crypto.SU3File",
Note: See TracChangeset for help on using the changeset viewer.