diff options
author | Piotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com> | 2020-12-17 16:03:07 +0100 |
---|---|---|
committer | Piotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com> | 2021-01-04 10:44:06 +0000 |
commit | 7d9906432263c37bbea44d74d15e9eaea19e310d (patch) | |
tree | 18616f924ab32ea2350ce18e8a37ec87a516f5d6 /certServiceClient/src/main | |
parent | 4f922581cabd32996b880b0f5ff9a5ae7cbc2c57 (diff) |
[OOM-CERT-SERVICE] Align implementation with RFC42102.1.1
- change MAC algorithm
- limit iterations to random value from 1000-2000 range
- correct caName validation to allow URL safe characters
Issue-ID: OOM-2656
(cherry picked from commit ee8b5cb717a4b7e37ef84e3e585be832d7d1794b)
Change-Id: I031382d208caa5eb659bb51f9d165344ca2e83b9
Signed-off-by: Piotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com>
Diffstat (limited to 'certServiceClient/src/main')
2 files changed, 3 insertions, 3 deletions
diff --git a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/AbstractConfigurationFactory.java b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/AbstractConfigurationFactory.java index 293ac2d1..b28a6921 100644 --- a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/AbstractConfigurationFactory.java +++ b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/AbstractConfigurationFactory.java @@ -38,8 +38,8 @@ public abstract class AbstractConfigurationFactory<T extends ConfigurationModel> return path.matches("^/|(/[a-zA-Z0-9_-]+)+/?$"); } - public boolean isAlphaNumeric(String caName) { - return caName.matches("^[a-zA-Z0-9]*$"); + public boolean isCaNameValid(String caName) { + return caName.matches("^[a-zA-Z0-9_.~-]{1,128}$"); } public boolean isCommonNameValid(String commonName) { diff --git a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java index 17cb2cc4..c9889419 100644 --- a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java +++ b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java @@ -56,7 +56,7 @@ public class ClientConfigurationFactory extends AbstractConfigurationFactory<Cli .orElseThrow(() -> new ClientConfigurationException(ClientConfigurationEnvs.OUTPUT_PATH + " is invalid.")); envsForClient.getCaName() - .filter(this::isAlphaNumeric) + .filter(this::isCaNameValid) .map(configuration::setCaName) .orElseThrow(() -> new ClientConfigurationException(ClientConfigurationEnvs.CA_NAME + " is invalid.")); |