On Mon, 9 May 2022 23:23:05 GMT, Valerie Peng <valer...@openjdk.org> wrote:
>> src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java line 229: >> >>> 227: if (key instanceof javax.crypto.interfaces.PBEKey >>> pbeKey) { >>> 228: salt = check(pbeKey.getSalt()); // may be null >>> 229: iCount = check(pbeKey.getIterationCount()); // may >>> be 0 >> >> It seems the return value is never 0. > > Oh, the comment about "may be 0" is meant toward the > pbeKey.getInterationCount() call... Hmm, I will make it clearer. I see. Another question, shall we reset `salt` and `iCount` at the beginning? If `params` is null and `key` is not `PBEKey` and there is an existing positive `iCount`, it will not be set to `DEFAULT_COUNT`. ------------- PR: https://git.openjdk.java.net/jdk/pull/8521