Integrated: 8293779: redundant checking in AESCrypt.makeSessionKey() method

Xue-Lei Andrew Fan xuelei at openjdk.org
Thu Sep 15 15:10:53 UTC 2022


On Wed, 14 Sep 2022 05:58:10 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

> Hi,
> 
> Please review this simple code cleanup.
> 
> The following checking for key in the makeSessionKey() method is redundant as it the same checking has been performance before calling the method.
> 
> 
>         if (k == null) {
>             throw new InvalidKeyException("Empty key");
>         }
>         if (!isKeySizeValid(k.length)) {
>              throw new InvalidKeyException("Invalid AES key length: " +
>                                            k.length + " bytes");
>         }
> 
> 
> No new regression test, simple cleanup.
> 
> Thanks,
> Xuelei

This pull request has now been integrated.

Changeset: ecb456ae
Author:    Xue-Lei Andrew Fan <xuelei at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/ecb456ae29ac155c7f5632fbe5cfc4c0c5b5c959
Stats:     10 lines in 1 file changed: 1 ins; 4 del; 5 mod

8293779: redundant checking in AESCrypt.makeSessionKey() method

Reviewed-by: djelinski, hchao, mullan

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

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


More information about the security-dev mailing list