Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliult committed Oct 19, 2022
1 parent 381be89 commit 32b37a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static boolean configureSecurityRestrict(Properties props) {
private static void initUserSecuritySetting() {

if (debug != null) {
debug.println("Load user security restrict settings.");
debug.println("Loading user security restrict settings.");
}

String[] inputs = userSecuritySetting.split(",");
Expand Down Expand Up @@ -245,7 +245,7 @@ private static void setSecurityRestrictProviders(Properties props, ArrayList<Str
private static void setSecurityRestrictProperties(Properties props, SecurityRestrictProperties properties) {

if (debug != null) {
debug.println("Add security restrict properties.");
debug.println("Adding security restrict properties.");
}

Map<String, String> propsMapping = new HashMap<>();
Expand All @@ -268,7 +268,7 @@ private static void setSecurityRestrictProperties(Properties props, SecurityRest
props.setProperty(jdkPropsName,
notNullEmpty(propsOldValue) ? propsOldValue + ", " + propsNewValue : propsNewValue);
if (debug != null) {
debug.println("Add security restrict properties, with property: " + jdkPropsName + " values: "
debug.println("Added security restrict properties, with property: " + jdkPropsName + " values: "
+ (notNullEmpty(propsOldValue) ? propsOldValue + ", " + propsNewValue : propsNewValue));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private void initSecurityRestrictProperties() {
.getProperty("SecurityRestrict" + userSecurityNum + ".securerandom.algorithm").trim();

if (debug != null) {
debug.println("Loaded Security Restrict properties.");
debug.println("Loaded security restrict properties.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/security/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -1381,14 +1381,14 @@ protected void putService(Service s) {
throw new IllegalArgumentException
("service.getProvider() must match this Provider object");
}
String type = s.getType();
String algorithm = s.getAlgorithm();
if (SecurityRestrictConfigurator.enableSecurityRestrict()) {
// If security restrict is not allow, then return without register
if (!SecurityRestrictProperties.getInstance().isConstraintsAllow(s)) {
return;
}
}
String type = s.getType();
String algorithm = s.getAlgorithm();
ServiceKey key = new ServiceKey(type, algorithm, true);
implRemoveService(serviceMap.get(key));
serviceMap.put(key, s);
Expand Down

0 comments on commit 32b37a6

Please sign in to comment.