RFR: 8254717: isAssignableFrom checks in KeyFactorySpi.engineGetKeySpec appear to be backwards [v2]

Ziyi Luo luoziyi at openjdk.java.net
Tue Mar 2 17:26:15 UTC 2021


> All of the "isAssignableFrom" checks in "engineGetKeySpec" appear to be backwards in Java's KeyFactorySpi.engineGetKeySpec implementations. In most cases, the requested KeySpec is equal to the concrete implementation so the inversion does not matter. But there are few cases, as presented in the added jtreg test, will cause unexpected behavior (e.g., ClassCastException rather than an InvalidKeySpecException). The fix is trivial.
> 
> Co-author @SalusaSecondus

Ziyi Luo has updated the pull request incrementally with one additional commit since the last revision:

  8254717: isAssignableFrom checks in KeyFactorySpi.engineGetKeySpec appear to be backwards (r2)

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2682/files
  - new: https://git.openjdk.java.net/jdk/pull/2682/files/0e4956db..d1972302

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2682&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2682&range=00-01

  Stats: 26 lines in 15 files changed: 2 ins; 0 del; 24 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2682.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2682/head:pull/2682

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


More information about the security-dev mailing list