Changeset 80966d60 for core


Ignore:
Timestamp:
Oct 23, 2016 4:38:26 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d2f7b65
Parents:
85223303
Message:

Crypto: Create keystore directory when making SSL keys (ticket #1866)
When we switched to new way of making keys in 0.9.25,
we omitted the mkdir step, which broke it.

File:
1 edited

Legend:

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

    r85223303 r80966d60  
    592592                                            int validDays, SigType type, String keyPW)
    593593                                                throws GeneralSecurityException, IOException {
     594        File dir = ks.getParentFile();
     595        if (dir != null && !dir.exists()) {
     596            File sdir = new SecureDirectory(dir.getAbsolutePath());
     597            if (!sdir.mkdirs())
     598                throw new IOException("Can't create directory " + dir);
     599        }
    594600        Object[] rv = SelfSignedGenerator.generate(cname, ou, "XX", "I2P Anonymous Network", "XX", "XX", validDays, type);
    595601        PublicKey jpub = (PublicKey) rv[0];
Note: See TracChangeset for help on using the changeset viewer.