Re: RFR: 8284926: Share the certificate NamedGroup in SignatureScheme::getSignerOfPreferableAlgorithm [v2]

2022-05-17 Thread John Jiang
On Mon, 18 Apr 2022 12:37:15 GMT, John Jiang  wrote:

>> It would not to generate the certificate's ECParameterSpec and NamedGroup 
>> multiple times in method `SignatureScheme::getSignerOfPreferableAlgorithm`.
>
> John Jiang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   cache ParamSpec and NamedGroup in X509Possession

@XueleiFan Just submitted a new commit and addressed your comments.

-

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


Re: RFR: 8284926: Share the certificate NamedGroup in SignatureScheme::getSignerOfPreferableAlgorithm [v2]

2022-05-16 Thread Xue-Lei Andrew Fan
On Mon, 18 Apr 2022 12:37:15 GMT, John Jiang  wrote:

>> It would not to generate the certificate's ECParameterSpec and NamedGroup 
>> multiple times in method `SignatureScheme::getSignerOfPreferableAlgorithm`.
>
> John Jiang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   cache ParamSpec and NamedGroup in X509Possession

src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java line 
274:

> 272: // Iteratively determine the X509Possession type's 
> ParameterSpec.
> 273: ECParameterSpec ecParams = 
> x509Possession.getECParameterSpec();
> 274: NamedParameterSpec namedParams = 
> x509Possession.getXECParameterSpec();

It may not necessary to define 'ecParams' and 'namedParams' any longer, which 
was used to find out the named group.  Now, the checking could be placed on the 
"namedGroup" (if the named group is EC/CDH) around line 293.

src/java.base/share/classes/sun/security/ssl/SignatureScheme.java line 476:

> 474: PrivateKey signingKey = x509Possession.popPrivateKey;
> 475: 
> 476: ECParameterSpec params = x509Possession.getECParameterSpec();

This 'params' variable is used for debug only.  Maybe, it could be moved to the 
debug log block.

src/java.base/share/classes/sun/security/ssl/X509Authentication.java line 157:

> 155: }
> 156: 
> 157: private ECParameterSpec getECParams() {

'getECParamSpec' may be a better method name.

src/java.base/share/classes/sun/security/ssl/X509Authentication.java line 182:

> 180: 
> 181: // Similar to above, but for XEC.
> 182: private NamedParameterSpec getXECParams() {

'getXECParamSpec' may be a better method name.

-

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


Re: RFR: 8284926: Share the certificate NamedGroup in SignatureScheme::getSignerOfPreferableAlgorithm [v2]

2022-04-18 Thread John Jiang
> It would not to generate the certificate's ECParameterSpec and NamedGroup 
> multiple times in method `SignatureScheme::getSignerOfPreferableAlgorithm`.

John Jiang has updated the pull request incrementally with one additional 
commit since the last revision:

  cache ParamSpec and NamedGroup in X509Possession

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8271/files
  - new: https://git.openjdk.java.net/jdk/pull/8271/files/4367d812..eb706ae8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8271&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8271&range=00-01

  Stats: 63 lines in 4 files changed: 43 ins; 15 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8271.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8271/head:pull/8271

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