Skip to content

Commit

Permalink
added some souts to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lovesh-ap committed Nov 8, 2024
1 parent df306ac commit 5cd58ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public class MessageDigest_Instrumentation {

public static MessageDigest getInstance(String algorithm) {
AbstractOperation operation = null;
System.out.println("Hook for MessageDigest intercepted");
boolean isOwaspHookEnabled = NewRelicSecurity.getAgent().isLowPriorityInstrumentationEnabled();
if (isOwaspHookEnabled && LowSeverityHelper.isOwaspHookProcessingNeeded()){
System.out.println("Going for MessageDigest event preparation");
operation = preprocessSecurityHook(algorithm, StringUtils.EMPTY, MessageDigest.class.getName(), "getInstance");
}
MessageDigest returnValue = null;
Expand All @@ -38,8 +40,10 @@ public static MessageDigest getInstance(String algorithm) {

public static MessageDigest getInstance(String algorithm, String provider) {
AbstractOperation operation = null;
System.out.println("Hook for MessageDigest intercepted");
boolean isOwaspHookEnabled = NewRelicSecurity.getAgent().isLowPriorityInstrumentationEnabled();
if (isOwaspHookEnabled && LowSeverityHelper.isOwaspHookProcessingNeeded()){
System.out.println("Going for MessageDigest event preparation");
operation = preprocessSecurityHook(algorithm, provider, MessageDigest.class.getName(), "getInstance");
}
MessageDigest returnValue = null;
Expand All @@ -55,8 +59,10 @@ public static MessageDigest getInstance(String algorithm, String provider) {

public static MessageDigest getInstance(String algorithm, Provider provider) {
AbstractOperation operation = null;
System.out.println("Hook for MessageDigest intercepted");
boolean isOwaspHookEnabled = NewRelicSecurity.getAgent().isLowPriorityInstrumentationEnabled();
if (isOwaspHookEnabled && LowSeverityHelper.isOwaspHookProcessingNeeded()){
System.out.println("Going for MessageDigest event preparation");
operation = preprocessSecurityHook(algorithm, provider.getClass().getSimpleName(), MessageDigest.class.getName(), "getInstance");
}
MessageDigest returnValue = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public Object call() throws Exception {
break;
case HASH:
HashCryptoOperation hashOperationalBean = (HashCryptoOperation) operation;
System.out.println("Hash event being prepared");
eventBean = prepareHashEvent(eventBean, hashOperationalBean);
break;
case JAVASCRIPT_INJECTION:
Expand Down

0 comments on commit 5cd58ad

Please sign in to comment.