Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/java.base/share/classes/java/security/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -1207,31 +1207,26 @@ public Set<Service> getServices() {
private static final class RedHatFIPSFilter {
static final boolean IS_ON = Boolean.parseBoolean(
Security.getProperty("__redhat_fips_filter__"));
private static final Set<String> ANY_SERVICE_TYPE = Set.of();
private static final Map<String, Set<String>> ALLOW_LIST = Map.of(
"SunPKCS11-FIPS", ANY_SERVICE_TYPE,
"SUN", Set.of(
"AlgorithmParameterGenerator",
"AlgorithmParameters", "CertificateFactory",
"CertPathBuilder", "CertPathValidator", "CertStore",
"Configuration", "KeyStore"),
"SunEC", Set.of(
"AlgorithmParameters", "KeyFactory"),
"SunJSSE", ANY_SERVICE_TYPE,
"SunJCE", Set.of(
"AlgorithmParameters",
"AlgorithmParameterGenerator", "KeyFactory",
"SecretKeyFactory"),
"SunRsaSign", Set.of(
"KeyFactory", "AlgorithmParameters"),
"XMLDSig", ANY_SERVICE_TYPE
"KeyFactory", "AlgorithmParameters")
);

static boolean isAllowed(String provName, String serviceType) {
Set<String> allowedServiceTypes = ALLOW_LIST.get(provName);
return allowedServiceTypes != null &&
(allowedServiceTypes == ANY_SERVICE_TYPE ||
allowedServiceTypes.contains(serviceType));
return allowedServiceTypes == null ||
allowedServiceTypes.contains(serviceType);
}
}
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIPS PATCH ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
Expand Down