|
23 | 23 | * questions. |
24 | 24 | */ |
25 | 25 |
|
26 | | -/* |
27 | | - * =========================================================================== |
28 | | - * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved |
29 | | - * =========================================================================== |
30 | | - */ |
31 | | - |
32 | 26 | package sun.security.ssl; |
33 | 27 |
|
34 | 28 | import java.math.BigInteger; |
35 | 29 | import java.security.*; |
36 | 30 | import java.security.interfaces.RSAPublicKey; |
37 | 31 | import java.security.spec.*; |
38 | 32 | import javax.crypto.*; |
| 33 | +import javax.swing.text.Utilities; |
39 | 34 |
|
40 | 35 | /** |
41 | 36 | * This class contains a few static methods for interaction with the JCA/JCE |
@@ -96,26 +91,6 @@ final class JsseJce { |
96 | 91 | */ |
97 | 92 | static final String SIGNATURE_ECDSA = "SHA1withECDSA"; |
98 | 93 |
|
99 | | - /** |
100 | | - * JCA identifier string for ECDSA, i.e. a ECDSA with SHA224. |
101 | | - */ |
102 | | - static final String SIGNATURE_ECDSA_224 = "SHA224withECDSA"; |
103 | | - |
104 | | - /** |
105 | | - * JCA identifier string for ECDSA, i.e. a ECDSA with SHA256. |
106 | | - */ |
107 | | - static final String SIGNATURE_ECDSA_256 = "SHA256withECDSA"; |
108 | | - |
109 | | - /** |
110 | | - * JCA identifier string for ECDSA, i.e. a ECDSA with SHA384. |
111 | | - */ |
112 | | - static final String SIGNATURE_ECDSA_384 = "SHA384withECDSA"; |
113 | | - |
114 | | - /** |
115 | | - * JCA identifier string for ECDSA, i.e. a ECDSA with SHA512. |
116 | | - */ |
117 | | - static final String SIGNATURE_ECDSA_512 = "SHA512withECDSA"; |
118 | | - |
119 | 94 | /** |
120 | 95 | * JCA identifier for EdDSA signatures. |
121 | 96 | */ |
@@ -188,38 +163,10 @@ private static class EcAvailability { |
188 | 163 | // Is EC crypto available? |
189 | 164 | private static final boolean isAvailable; |
190 | 165 |
|
191 | | - /** |
192 | | - * Checks if a particular signature algorithm is available. |
193 | | - * |
194 | | - * @param algorithm the algorithm we will attempt to instantiate to check if it is available |
195 | | - * @return true if the signature algorithm is found, false otherwise |
196 | | - */ |
197 | | - private static boolean isSignatureAlgorithmAvailable(String algorithm) { |
198 | | - try { |
199 | | - // Attempt to create a Cipher instance with the specified algorithm. |
200 | | - Signature.getInstance(algorithm); |
201 | | - return true; |
202 | | - } catch (NoSuchAlgorithmException e) { |
203 | | - return false; |
204 | | - } |
205 | | - } |
206 | | - |
207 | 166 | static { |
208 | 167 | boolean mediator = true; |
209 | 168 | try { |
210 | | - // When running in FIPS mode, the signature "SHA1withECDSA" is not |
211 | | - // available by default. In this scenario we should still set EC |
212 | | - // availability to true since other algorithms in the ECDSA signature |
213 | | - // family are available for use in various ECDSA TLS ciphers. All |
214 | | - // FIPS solutions are expected to have an algorithm such as |
215 | | - // "SHA512withECDSA", "SHA384withECDSA", "SHA256withECDSA", or |
216 | | - // "SHA224withECDSA" available so we will also check for these algorithms. |
217 | | - mediator = isSignatureAlgorithmAvailable(SIGNATURE_ECDSA) |
218 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_224) |
219 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_256) |
220 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_384) |
221 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_512); |
222 | | - |
| 169 | + Signature.getInstance(SIGNATURE_ECDSA); |
223 | 170 | Signature.getInstance(SIGNATURE_RAWECDSA); |
224 | 171 | KeyAgreement.getInstance("ECDH"); |
225 | 172 | KeyFactory.getInstance("EC"); |
|
0 commit comments