aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-13 14:54:44 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-13 14:54:44 +0000
commit770b6c0c3637762de8ad73963167b7d12d72fded (patch)
tree3de23ffc7ea5d7a0a138d610d7b144916aceafec
parent9733bbd0b124a4e646ab1c616b55fe1d4d75f3c4 (diff)
sonar security issue fix- Make sure that hashing data is safe here
Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Issue-ID: CLI-270 Change-Id: If8f46a3773963f56f4912be2decb6d92e164cccc
-rw-r--r--framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java2
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java2
2 files changed, 2 insertions, 2 deletions
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);