diff options
Diffstat (limited to 'cmso-topology')
-rw-r--r-- | cmso-topology/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java | 7 | ||||
-rw-r--r-- | cmso-topology/src/main/resources/META-INF/resources/swagger/swagger.json | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/cmso-topology/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java b/cmso-topology/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java index 8af1aea..518ce0c 100644 --- a/cmso-topology/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java +++ b/cmso-topology/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java @@ -49,6 +49,7 @@ public class PropertiesManagement { private static final String transformation = algorithm + "/" + cipherMode + "/" + paddingScheme; private static final SecureRandom random = new SecureRandom(); + @Autowired Environment env; @@ -93,7 +94,7 @@ public class PropertiesManagement { private static final String encrypt(String key, String value) { try { - byte[] bytesIV = new byte[16]; + byte[] bytesIV = new byte[12]; random.nextBytes(bytesIV); IvParameterSpec iv = new IvParameterSpec(bytesIV); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); @@ -111,9 +112,9 @@ public class PropertiesManagement { private static final String decrypt(String key, String encrypted) { try { - byte[] bytesIV = new byte[16]; + byte[] bytesIV = new byte[12]; random.nextBytes(bytesIV); - IvParameterSpec iv = new IvParameterSpec(bytesIV); + IvParameterSpec iv = new IvParameterSpec(bytesIV); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); Cipher cipher = Cipher.getInstance(transformation); cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv); diff --git a/cmso-topology/src/main/resources/META-INF/resources/swagger/swagger.json b/cmso-topology/src/main/resources/META-INF/resources/swagger/swagger.json index c6aeba7..a5abc3f 100644 --- a/cmso-topology/src/main/resources/META-INF/resources/swagger/swagger.json +++ b/cmso-topology/src/main/resources/META-INF/resources/swagger/swagger.json @@ -1,7 +1,7 @@ { "swagger" : "2.0", "info" : { - "version" : "2.3.1-SNAPSHOT", + "version" : "2.3.2-SNAPSHOT", "title" : "cmso-topology" }, "basePath" : "/topology", |