jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
changeset 16910 d0ed88d92afe
parent 16909 78a1749a43e2
child 25402 0c24d9aa8fb9
equal deleted inserted replaced
16909:78a1749a43e2 16910:d0ed88d92afe
    99             throw new InvalidKeySpecException("Iteration count is negative");
    99             throw new InvalidKeySpecException("Iteration count is negative");
   100         }
   100         }
   101         int keyLength = keySpec.getKeyLength();
   101         int keyLength = keySpec.getKeyLength();
   102         if (keyLength == 0) {
   102         if (keyLength == 0) {
   103             throw new InvalidKeySpecException("Key length not found");
   103             throw new InvalidKeySpecException("Key length not found");
   104         } else if (keyLength == 0) {
   104         } else if (keyLength < 0) {
   105             throw new InvalidKeySpecException("Key length is negative");
   105             throw new InvalidKeySpecException("Key length is negative");
   106         }
   106         }
   107         try {
   107         try {
   108             this.prf = Mac.getInstance(prfAlgo, SunJCE.getInstance());
   108             this.prf = Mac.getInstance(prfAlgo, SunJCE.getInstance());
   109         } catch (NoSuchAlgorithmException nsae) {
   109         } catch (NoSuchAlgorithmException nsae) {