RFR: 8279800: isAssignableFrom checks in AlgorithmParametersSpi.engineGetParameterSpec appear to be backwards

Xue-Lei Andrew Fan xuelei at openjdk.java.net
Wed Jan 12 20:52:28 UTC 2022


On Wed, 12 Jan 2022 20:01:10 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Right, I suppose so.
>
> PBEKeyFactory.java, PBKDF2Core.java and PBKDF2HmacSHA1Factory.java also have isAssignableFrom() calls which seem backward. Perhaps covering them as well?

> If so, then the `if` block will be true and the spec object is casted to your specified class (`AlgorithmParameterSpec.class` or `Object.class`) and it always succeeds.
> 
> This is exactly what I want to achieve.

Unfortunately, there is a returned value that we cannot return an object of any class.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7037



More information about the security-dev mailing list