Skip to content

Commit 93c7f76

Browse files
committed
RH2134669: Add missing attributes when registering services in FIPS mode.
Backport-Of: 7aaa009fd949b22d8be068b1df6733330a60f85c
1 parent b2cfaee commit 93c7f76

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/java.base/share/classes/sun/security/provider/SunEntries.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,16 @@ public static List<String> createAliasesWithOid(String ... oids) {
174174
add(p, "Signature", "SHA256withDSAinP1363Format",
175175
"sun.security.provider.DSA$SHA256withDSAinP1363Format",
176176
null, null);
177+
}
177178

178-
/*
179-
* Key Pair Generator engines
180-
*/
181-
attrs.clear();
182-
attrs.put("ImplementedIn", "Software");
183-
attrs.put("KeySize", "2048"); // for DSA KPG and APG only
179+
/*
180+
* Key Pair Generator engines
181+
*/
182+
attrs.clear();
183+
attrs.put("ImplementedIn", "Software");
184+
attrs.put("KeySize", "2048"); // for DSA KPG and APG only
184185

186+
if (!systemFipsEnabled) {
185187
String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$";
186188
dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current");
187189
add(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, dsaAliases, attrs);

src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ public SunRsaSignEntries(Provider p) {
6161

6262
// common attribute map
6363
HashMap<String, String> attrs = new HashMap<>(3);
64-
if (!systemFipsEnabled) {
65-
attrs.put("SupportedKeyClasses",
66-
"java.security.interfaces.RSAPublicKey" +
67-
"|java.security.interfaces.RSAPrivateKey");
68-
}
64+
attrs.put("SupportedKeyClasses",
65+
"java.security.interfaces.RSAPublicKey" +
66+
"|java.security.interfaces.RSAPrivateKey");
6967

7068
add(p, "KeyFactory", "RSA",
7169
"sun.security.rsa.RSAKeyFactory$Legacy",

0 commit comments

Comments
 (0)