diff options
author | Serban Popescu <serban.popescu@amdocs.com> | 2019-01-23 10:58:12 -0500 |
---|---|---|
committer | Serban Popescu <serban.popescu@amdocs.com> | 2019-01-23 13:56:48 -0500 |
commit | 6833fb0a9a3f8c26688ad5c323eb266827b707c2 (patch) | |
tree | 9cba99c07727b9d072e1e9b934a96f1fa6f97db9 /src/main/java/org/onap | |
parent | 83dd58fde9eb9ab0d1e6b69228b1695380d1a22c (diff) |
Do not try to unobfuscate clear text passwords
The keystore password does not need to be decrypted if in clear text
Change-Id: Ia0d8591e1d5ca6890fcb77295de9573921f6652f
Issue-ID: AAI-2072
Signed-off-by: Serban Popescu <serban.popescu@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r-- | src/main/java/org/onap/aai/babel/BabelApplication.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/onap/aai/babel/BabelApplication.java b/src/main/java/org/onap/aai/babel/BabelApplication.java index 868cff3..9cf1078 100644 --- a/src/main/java/org/onap/aai/babel/BabelApplication.java +++ b/src/main/java/org/onap/aai/babel/BabelApplication.java @@ -31,6 +31,8 @@ import org.springframework.context.annotation.ImportResource; @ImportResource("classpath:babel-beans.xml") public class BabelApplication extends SpringBootServletInitializer { + private static final String OBFS_PATTERN = "OBF:"; + /** * Spring Boot Initialization. * @@ -42,7 +44,8 @@ public class BabelApplication extends SpringBootServletInitializer { throw new IllegalArgumentException("Env property KEY_STORE_PASSWORD not set"); } HashMap<String, Object> props = new HashMap<>(); - props.put("server.ssl.key-store-password", Password.deobfuscate(keyStorePassword)); + String decryptedValue = keyStorePassword.startsWith(OBFS_PATTERN)? Password.deobfuscate(keyStorePassword) : keyStorePassword; + props.put("server.ssl.key-store-password", decryptedValue); new BabelApplication().configure(new SpringApplicationBuilder(BabelApplication.class).properties(props)) .run(args); } |