public class Taint extends Object
TaintFrame| Modifier and Type | Class and Description |
|---|---|
static class |
Taint.State |
static class |
Taint.Tag |
| Constructor and Description |
|---|
Taint(Taint.State state)
Constructs a new empty instance of Taint with the specified state
|
Taint(Taint taint)
Creates a hard copy of the specified Taint instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLocation(TaintLocation location,
boolean isKnownTaintSource)
Adds location for a taint source or path to remember for reporting
|
boolean |
addTag(Taint.Tag tag)
Adds the specified taint tag to this fact or marks this tag to add
if this fact acts like a derivation of taint transfer behaviour
|
boolean |
equals(Object obj) |
Collection<TaintLocation> |
getAllLocations() |
String |
getConstantValue()
Returns the constant value of the string or char if known
|
String |
getDebugInfo()
Gets the info for debugging merged from all used facts
|
Taint.State |
getNonParametricState()
Gets the state influencing the state of this fact if dependant on method
arguments, final state is given by merge of that state and arguments
|
Set<Integer> |
getParameters()
Returns the method arguments influencing the taint state of this fact
|
org.apache.bcel.generic.ObjectType |
getRealInstanceClass()
Finds out the real type of instance matching this fact if possible
|
String |
getRealInstanceClassName()
Finds out the real class name of instance matching this fact if possible
|
Taint.State |
getState()
Returns the taint state of this fact
|
Set<Taint.Tag> |
getTags()
Returns all present taint tags for this fact
|
Set<Taint.Tag> |
getTagsToRemove()
Returns tags to remove (if this fact acts like a taint derivation spec.)
|
Set<TaintLocation> |
getTaintedLocations()
Returns locations with taint sources or nodes on path from those
sources, if there are some locations confirmed to be tainted,
only those are returned
|
Collection<TaintLocation> |
getUnknownLocations() |
int |
getVariableIndex()
If known (check first), returns the index of the local variable,
where the value matching this fact is stored
|
int |
hashCode() |
boolean |
hasParameters()
Checks if the taint state of this fact depends on the method arguments
|
boolean |
hasTag(Taint.Tag tag)
Checks whether the specified taint tag is present for this fact
|
boolean |
hasTags()
Checks if there are any taint tags for this fact
|
boolean |
hasValidVariableIndex()
Checks if the index of the local variable matching this fact is known
|
boolean |
isRemovingTags()
Checks if there are some tags to remove
(if this fact acts like a taint derivation spec.)
|
boolean |
isSafe()
Checks whether values matching this fact are always trusted
|
boolean |
isTainted()
Checks whether values matching this fact are probably untrusted
|
boolean |
isUnknown()
Checks whether values matching this fact can be untrusted but also safe
|
static Taint |
merge(Taint a,
Taint b)
Returns the merge of the facts such that it can represent any of them
|
boolean |
removeTag(Taint.Tag tag)
Removes the specified tag (if present) or marks this tag to remove
if this fact acts like a derivation of taint transfer behaviour
|
Taint |
setDebugInfo(String debugInfo)
Sets info for debugging purposes (consumes much memory)
|
String |
toString() |
static Taint |
valueOf(String stateName)
Constructs a new instance of taint from the specified state name
|
static Taint |
valueOf(Taint.State state)
Constructs a new instance of taint from the specified state
|
public Taint(Taint.State state)
state - state of the factNullPointerException - if argument is nullIllegalArgumentException - if argument is INVALIDpublic Taint(Taint taint)
taint - instance to copyNullPointerException - if argument is nullpublic Taint.State getState()
public int getVariableIndex()
IllegalStateException - if index is uknownpublic boolean hasValidVariableIndex()
public void addLocation(TaintLocation location, boolean isKnownTaintSource)
location - location to rememberisKnownTaintSource - true for tainted value, false if just not safeNullPointerException - if location is nullpublic Set<TaintLocation> getTaintedLocations()
public Collection<TaintLocation> getUnknownLocations()
public Collection<TaintLocation> getAllLocations()
public boolean isSafe()
public boolean isTainted()
public boolean isUnknown()
public boolean hasParameters()
public Set<Integer> getParameters()
public Taint.State getNonParametricState()
public org.apache.bcel.generic.ObjectType getRealInstanceClass()
public String getRealInstanceClassName()
public boolean addTag(Taint.Tag tag)
tag - tag to addpublic boolean hasTag(Taint.Tag tag)
tag - tag to checkpublic boolean hasTags()
public Set<Taint.Tag> getTags()
public boolean removeTag(Taint.Tag tag)
tag - tag to removepublic boolean isRemovingTags()
public Set<Taint.Tag> getTagsToRemove()
public String getConstantValue()
public static Taint valueOf(String stateName)
stateName - name of the stateIllegalArgumentException - if the name does not match any statepublic static Taint valueOf(Taint.State state)
state - the specified stateNullPointerException - if state is nullpublic static Taint merge(Taint a, Taint b)
a - first state to mergeb - second state to mergepublic String getDebugInfo()
public Taint setDebugInfo(String debugInfo)
debugInfo - info to storeCopyright © 2017. All rights reserved.