On Tue, 3 Nov 2026 05:36:58 GMT, Timofei Fedotov <[email protected]> wrote:
>> EdDSAPublicKeyImpl(byte[]) reads the last byte of the encoded point before >> invoking checkLength(). An empty subjectPublicKey BIT STRING produces a >> zero-length array and causes an access at index -1. >> >> The error is reachable through KeyFactory.generatePublic() with an >> X509EncodedKeySpec and through certificate parsing that decodes an EdDSA >> SubjectPublicKeyInfo. A minimal Ed25519 SubjectPublicKeyInfo reproducer is >> the DER byte sequence 300a300506032b6570030100. >> >> A malformed encoded key must be rejected with the normal checked key-parsing >> exception rather than an array indexing exception. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Timofei Fedotov has updated the pull request incrementally with one > additional commit since the last revision: > > Add the SunEC provider explicitly and remove the redundant positive key > generation checks @Sovtouch Your change (at version 1ca42d2f3a8f74b0c91a563e876d74038fb801f0) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/33641#issuecomment-6624017224
