[SNMP4J] Freezing when creating an Snmp object

Jackie Cheng (jaccheng) jaccheng at cisco.com
Fri Jun 17 19:51:01 CEST 2005


I have the same issue with "some" linux machines. 
 
A change, add setSeed() before netBytes(), to the Salt() class may fix
this problem.
 
 
  protected Salt() {
    byte[] rnd = new byte[8];
 
    try {
      SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
      sr.setSeed( new Date().getTime() );
      sr.nextBytes(rnd);
    }
    catch (NoSuchAlgorithmException nsae) {
        logger.warn("Could not use SecureRandom. Using Random
instead.");
      Random r = new Random();
      r.nextBytes(rnd);
    }
 
--Jackie
 



More information about the SNMP4J mailing list