hanicz commented on code in PR #1212:
URL: https://github.com/apache/knox/pull/1212#discussion_r3129429848


##########
gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultCryptoService.java:
##########
@@ -57,11 +58,18 @@ public void setAliasService(AliasService as) {
 
   @Override
   public void init(GatewayConfig config, Map<String, String> options)
-      throws ServiceLifecycleException {
+          throws ServiceLifecycleException {
     this.config = config;
-  if (aliasService == null) {
+    if (aliasService == null) {
       throw new ServiceLifecycleException("Alias service is not set");
     }
+    if (FipsUtils.isFipsEnabledWithBCProvider()) {
+      //invoking the following getters will throw IllegalArgumentException in 
case a forbidden algorithm is set
+      //so we can use them as a validation at service initialization time
+      config.getCredentialStoreAlgorithm();
+      config.getAlgorithm();
+      config.getPBEAlgorithm();

Review Comment:
   Moved them into FipsUtils



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to