src/java.base/share/classes/sun/security/ssl/NamedGroup.java
changeset 59214 e7df7c86eda1
parent 57718 a93b7b28f644
equal deleted inserted replaced
59213:229aa067e4cc 59214:e7df7c86eda1
   248         this.spec = namedGroupSpec;
   248         this.spec = namedGroupSpec;
   249         this.algorithm = namedGroupSpec.algorithm;
   249         this.algorithm = namedGroupSpec.algorithm;
   250         this.supportedProtocols = supportedProtocols;
   250         this.supportedProtocols = supportedProtocols;
   251         this.keAlgParamSpec = keAlgParamSpec;
   251         this.keAlgParamSpec = keAlgParamSpec;
   252 
   252 
       
   253         // Check if it is a supported named group.
   253         AlgorithmParameters algParams = null;
   254         AlgorithmParameters algParams = null;
   254         boolean mediator = (keAlgParamSpec != null);
   255         boolean mediator = (keAlgParamSpec != null);
       
   256 
       
   257         // HACK CODE
       
   258         //
       
   259         // An EC provider, for example the SunEC provider, may support
       
   260         // AlgorithmParameters but not KeyPairGenerator or KeyAgreement.
       
   261         if (mediator && (namedGroupSpec == NamedGroupSpec.NAMED_GROUP_ECDHE)) {
       
   262             mediator = JsseJce.isEcAvailable();
       
   263         }
       
   264 
       
   265         // Check the specific algorithm parameters.
   255         if (mediator) {
   266         if (mediator) {
   256             try {
   267             try {
   257                 algParams =
   268                 algParams =
   258                     AlgorithmParameters.getInstance(namedGroupSpec.algorithm);
   269                     AlgorithmParameters.getInstance(namedGroupSpec.algorithm);
   259                 algParams.init(keAlgParamSpec);
   270                 algParams.init(keAlgParamSpec);