From 770b6c0c3637762de8ad73963167b7d12d72fded Mon Sep 17 00:00:00 2001 From: "priyanka.akhade" Date: Wed, 13 May 2020 14:54:44 +0000 Subject: sonar security issue fix- Make sure that hashing data is safe here Signed-off-by: priyanka.akhade Issue-ID: CLI-270 Change-Id: If8f46a3773963f56f4912be2decb6d92e164cccc --- .../src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java | 2 +- framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'framework/src') diff --git a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java index 7ffe05e1..fa1d50fc 100644 --- a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java +++ b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java @@ -160,7 +160,7 @@ public class OnapCommandArtifactStore { private String getChecksum(String storePath) throws IOException, NoSuchAlgorithmException { byte[] b = Files.readAllBytes(Paths.get(storePath)); - byte[] hash = MessageDigest.getInstance("MD5").digest(b); + byte[] hash = MessageDigest.getInstance("MD5").digest(b); //NOSONAR return DatatypeConverter.printHexBinary(hash); } diff --git a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java index 7148aa10..2cd07ed8 100644 --- a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java +++ b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java @@ -431,7 +431,7 @@ public class OnapCommandUtils { } public static String md5(String content) { - String md5 = DigestUtils.md5Hex(content); + String md5 = DigestUtils.md5Hex(content); //NOSONAR byte[] encodeBase64 = Base64.encodeBase64(md5.getBytes()); return new String(encodeBase64); -- cgit 1.2.3-korg