Changeset ee6730f


Ignore:
Timestamp:
Feb 3, 2011 3:46:24 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
041e194
Parents:
db93421
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/RandomSource.java

    rdb93421 ree6730f  
    147147        // why urandom?  because /dev/random blocks, and there are arguments
    148148        // suggesting such blockages are largely meaningless
    149         boolean ok = seedFromFile("/dev/urandom", buf);
     149        boolean ok = seedFromFile(new File("/dev/urandom"), buf);
    150150        // we merge (XOR) in the data from /dev/urandom with our own seedfile
    151         ok = seedFromFile("prngseed.rnd", buf) || ok;
     151        File localFile = new File(_context.getConfigDir(), SEEDFILE);
     152        ok = seedFromFile(localFile, buf) || ok;
    152153        return ok;
    153154    }
    154155   
    155     private static final boolean seedFromFile(String filename, byte buf[]) {
    156         File f = new File(I2PAppContext.getGlobalContext().getConfigDir(), filename);
     156    /**
     157     *  @param f absolute path
     158     *  @return success
     159     */
     160    private static final boolean seedFromFile(File f, byte buf[]) {
    157161        if (f.exists()) {
    158162            FileInputStream fis = null;
Note: See TracChangeset for help on using the changeset viewer.