|
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; |
@@ -96,26 +90,6 @@ final class JsseJce { |
96 | 90 | */ |
97 | 91 | static final String SIGNATURE_ECDSA = "SHA1withECDSA"; |
98 | 92 |
|
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 | 93 | /** |
120 | 94 | * JCA identifier for EdDSA signatures. |
121 | 95 | */ |
@@ -189,38 +163,10 @@ private static class EcAvailability { |
189 | 163 | // Is EC crypto available? |
190 | 164 | private static final boolean isAvailable; |
191 | 165 |
|
192 | | - /** |
193 | | - * Checks if a particular signature algorithm is available. |
194 | | - * |
195 | | - * @param algorithm the algorithm we will attempt to instantiate to check if it is available |
196 | | - * @return true if the signature algorithm is found, false otherwise |
197 | | - */ |
198 | | - private static boolean isSignatureAlgorithmAvailable(String algorithm) { |
199 | | - try { |
200 | | - // Attempt to create a Cipher instance with the specified algorithm. |
201 | | - Signature.getInstance(algorithm); |
202 | | - return true; |
203 | | - } catch (NoSuchAlgorithmException e) { |
204 | | - return false; |
205 | | - } |
206 | | - } |
207 | | - |
208 | 166 | static { |
209 | 167 | boolean mediator = true; |
210 | 168 | try { |
211 | | - // When running in FIPS mode, the signature "SHA1withECDSA" is not |
212 | | - // available by default. In this scenario we should still set EC |
213 | | - // availability to true since other algorithms in the ECDSA signature |
214 | | - // family are available for use in various ECDSA TLS ciphers. All |
215 | | - // FIPS solutions are expected to have an algorithm such as |
216 | | - // "SHA512withECDSA", "SHA384withECDSA", "SHA256withECDSA", or |
217 | | - // "SHA224withECDSA" available so we will also check for these algorithms. |
218 | | - mediator = isSignatureAlgorithmAvailable(SIGNATURE_ECDSA) |
219 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_224) |
220 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_256) |
221 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_384) |
222 | | - || isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_512); |
223 | | - |
| 169 | + Signature.getInstance(SIGNATURE_ECDSA); |
224 | 170 | Signature.getInstance(SIGNATURE_RAWECDSA); |
225 | 171 | KeyAgreement.getInstance("ECDH"); |
226 | 172 | KeyFactory.getInstance("EC"); |
|
0 commit comments