corretto / amazon-corretto-crypto-provider

The Amazon Corretto Crypto Provider is a collection of high-performance cryptographic implementations exposed via standard JCA/JCE interfaces.
Apache License 2.0
236 stars 55 forks source link

Fix NullPointerException on invalid keys #363

Closed SalusaSecondus closed 8 months ago

SalusaSecondus commented 9 months ago

ACCP can throw an incorrect NullPointerException when attempting to translate invalid keys with null formats. Per the JDK documentation this should throw an InvalidKeySpecException instead. By throwing the incorrect exception ACCP prevents the JCA from correctly falling back to providers which might support the keys.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.