RFR: 6205692: (spec) javax.crypto.MacSpi.engineUpdate(ByteBuffer input): NPE should be specified [v2]

Valerie Peng valeriep at openjdk.org
Fri Aug 12 19:33:12 UTC 2022


On Fri, 12 Aug 2022 19:25:04 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> @valeriepeng see https://github.com/openjdk/jdk/pull/9859/commits/0bc0394e7a72f40b1f8f7cd4056b5906d4b89eda for the proposed change.
>> 
>> Let me know what you think about consistency within the files wrt `@throws` vs `@exception`.
>
> For this particular case, I would go for @throws. Moving toward the newer notation seems better.

> @valeriepeng I totally agree about `@throws`. I was just going for consistency within the file. There are other `@exception` appearances.
> 
> Yes, I do agree about the `update(ByteBuffer)` in Mac as well; however this one throws `IllegalArgumentException` if the parameter is null. Or were you referring to another version of the `update` method?

Right, I should have not stated NPE, but rather the IAE caused by null argument. For completeness sake, perhaps we can cover NPE for Mac.update(byte[]) also? Since we are filing CSR already. It'd be great if this fix covers both Mac and MacSpi regarding null argument of the update(...)/engineUpdate(..) methods. Or, if that's a bit much, then we should strive to cover Mac.update(ByteBuffer)/MacSpi.engineUpdate(ByteBuffer) methods for completeness sake.

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

PR: https://git.openjdk.org/jdk/pull/9859



More information about the security-dev mailing list