RFR: 8026976: ECParameters, Point does not match field size

Anthony Scarpino ascarpino at openjdk.java.net
Wed Dec 2 17:51:56 UTC 2020


On Wed, 2 Dec 2020 17:34:11 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>> I need a code review for this small code change.  The code did not run the data through the DER decoding class before setting it to the point when the SunPKCS11 configuration had UseEcX963Encoding set to false.
>
> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11ECKeyFactory.java line 303:
> 
>> 301:                 } else {
>> 302:                     point = decodePoint(attributes[0].getByteArray(), params.getCurve());
>> 303:                 }
> 
> You could save a "!" operation in 299 if switch line 302 and line 300.

I only used "!" for consistency with existing usage in PK11Key.java:1080.    Is there a reason to avoid "!" other than maybe readability?

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

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



More information about the security-dev mailing list