-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mario.vidal/taint_tracking_string_builder_…
…set_length
- Loading branch information
Showing
88 changed files
with
2,680 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...gent/agent-iast/src/main/java/com/datadog/iast/securitycontrol/AbstractMethodAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.datadog.iast.securitycontrol; | ||
|
||
import datadog.trace.api.iast.securitycontrol.SecurityControl; | ||
import org.objectweb.asm.MethodVisitor; | ||
import org.objectweb.asm.Opcodes; | ||
import org.objectweb.asm.Type; | ||
|
||
public class AbstractMethodAdapter extends MethodVisitor { | ||
|
||
private static final String HELPER = | ||
"datadog/trace/api/iast/securitycontrol/SecurityControlHelper"; | ||
private static final String METHOD = "setSecureMarks"; | ||
private static final String DESCRIPTOR = "(Ljava/lang/Object;I)V"; | ||
protected final MethodVisitor mv; | ||
protected final SecurityControl securityControl; | ||
protected final int accessFlags; | ||
protected final Type method; | ||
|
||
public AbstractMethodAdapter( | ||
final MethodVisitor mv, | ||
final SecurityControl securityControl, | ||
final int accessFlags, | ||
final Type method) { | ||
super(Opcodes.ASM9, mv); | ||
this.mv = mv; | ||
this.securityControl = securityControl; | ||
this.accessFlags = accessFlags; | ||
this.method = method; | ||
} | ||
|
||
protected boolean isStatic() { | ||
return (accessFlags & Opcodes.ACC_STATIC) > 0; | ||
} | ||
|
||
/** | ||
* This method loads the current secure marks defined in the control and then calls the helper | ||
* method | ||
*/ | ||
protected void loadMarksAndCallHelper() { | ||
// Load the marks from securityControl onto the stack | ||
mv.visitLdcInsn(securityControl.getMarks()); | ||
// Insert the call to setSecureMarks with the return value and marks as parameters | ||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, HELPER, METHOD, DESCRIPTOR, false); | ||
} | ||
} |
Oops, something went wrong.