From 62e97c96afe7e1400eda5c085dc3619a81691638 Mon Sep 17 00:00:00 2001 From: efiacor Date: Thu, 10 Mar 2022 15:35:58 +0000 Subject: [DMAAP-DR] Fix sec hotspots Signed-off-by: efiacor Change-Id: I4fb02bd7874d51e340faec17dad985e2382234f8 Issue-ID: DMAAP-1624 --- .../src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java | 2 +- .../src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'datarouter-node/src/main') diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java index eb79b563..55ad6aa8 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java @@ -117,7 +117,7 @@ public class DeliveryTask implements Runnable, Comparable { String header = line.substring(0, index); String headerValue = line.substring(index + 1); if ("x-dmaap-dr-routing".equalsIgnoreCase(header)) { - subid = headerValue.replaceAll("[^ ]*/", ""); + subid = headerValue.replaceAll("[^ ]*/+", ""); feedid = deliveryTaskHelper.getFeedId(subid.replaceAll(" .*", "")); } if (length == 0 && header.toLowerCase().startsWith("content-")) { diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java index 37e5db60..2c8dcdb0 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java @@ -99,14 +99,14 @@ public class NodeUtils { */ public static String getNodeAuthHdr(String node, String key) { try { - MessageDigest md = MessageDigest.getInstance("SHA"); + MessageDigest md = MessageDigest.getInstance("SHA-512"); md.update(key.getBytes()); md.update(node.getBytes()); md.update(key.getBytes()); return (getAuthHdr(node, base64Encode(md.digest()))); } catch (Exception exception) { eelfLogger - .error("Exception in generating Credentials for given node name:= " + exception.toString(), + .error("Exception in generating Credentials for given node name:= " + exception.getMessage(), exception); return (null); } -- cgit 1.2.3-korg