Skip to content

Commit 054b1bb

Browse files
authored
Merge pull request #590 from JinhangZhang/jdk/features/revert/jssechangestoenableecdhciphers
Revert Enable ECDSA ciphers when running with FIPS cryptography
2 parents dce8bab + dbdaff4 commit 054b1bb

File tree

1 file changed

+1
-55
lines changed

1 file changed

+1
-55
lines changed

src/java.base/share/classes/sun/security/ssl/JsseJce.java

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
* questions.
2424
*/
2525

26-
/*
27-
* ===========================================================================
28-
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29-
* ===========================================================================
30-
*/
31-
3226
package sun.security.ssl;
3327

3428
import java.math.BigInteger;
@@ -96,26 +90,6 @@ final class JsseJce {
9690
*/
9791
static final String SIGNATURE_ECDSA = "SHA1withECDSA";
9892

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-
11993
/**
12094
* JCA identifier for EdDSA signatures.
12195
*/
@@ -189,38 +163,10 @@ private static class EcAvailability {
189163
// Is EC crypto available?
190164
private static final boolean isAvailable;
191165

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-
208166
static {
209167
boolean mediator = true;
210168
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);
224170
Signature.getInstance(SIGNATURE_RAWECDSA);
225171
KeyAgreement.getInstance("ECDH");
226172
KeyFactory.getInstance("EC");

0 commit comments

Comments
 (0)