public class MethodSourceSinkDefinition extends AbstractSourceSinkDefinition implements IAccessPathBasedSourceSinkDefinition
| Modifier and Type | Class and Description |
|---|---|
static class |
MethodSourceSinkDefinition.CallType
Enumeration containing the different types of method invocations that can be
defined as sources or sinks
|
| Modifier and Type | Field and Description |
|---|---|
protected Set<AccessPathTuple> |
baseObjects |
protected MethodSourceSinkDefinition.CallType |
callType |
protected SootMethodAndClass |
method |
protected Set<AccessPathTuple>[] |
parameters |
protected Set<AccessPathTuple> |
returnValues |
category| Constructor and Description |
|---|
MethodSourceSinkDefinition(Set<AccessPathTuple> baseObjects,
Set<AccessPathTuple>[] parameters,
Set<AccessPathTuple> returnValues,
MethodSourceSinkDefinition.CallType callType)
Creates a new instance of the
MethodSourceSinkDefinition class
without a method. |
MethodSourceSinkDefinition(SootMethodAndClass am)
Creates a new instance of the
MethodSourceSinkDefinition class |
MethodSourceSinkDefinition(SootMethodAndClass am,
MethodSourceSinkDefinition.CallType callType)
Creates a new instance of the
MethodSourceSinkDefinition class |
MethodSourceSinkDefinition(SootMethodAndClass am,
Set<AccessPathTuple> baseObjects,
Set<AccessPathTuple>[] parameters,
Set<AccessPathTuple> returnValues,
MethodSourceSinkDefinition.CallType callType)
Creates a new instance of the MethodSourceSinkDefinition class
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameterDefinition(int paramIdx,
Set<AccessPathTuple> paramDefs)
Adds the given access path tuples to this source/sink definition for the
given parameter index
|
protected MethodSourceSinkDefinition |
buildNewDefinition(Set<AccessPathTuple> baseAPTs,
Set<AccessPathTuple>[] paramAPTs,
Set<AccessPathTuple> returnAPTs)
Factory method for creating a new method-based source/sink definition based
on the current one.
|
protected MethodSourceSinkDefinition |
buildNewDefinition(SootMethodAndClass methodAndclass,
Set<AccessPathTuple> filteredBaseObjects,
Set<AccessPathTuple>[] filteredParameters,
Set<AccessPathTuple> filteredReturnValues,
MethodSourceSinkDefinition.CallType callType) |
static MethodSourceSinkDefinition |
createParameterSource(int index,
MethodSourceSinkDefinition.CallType callType)
Creates a source definition that considers a parameter as tainted
|
static MethodSourceSinkDefinition |
createReturnSource(MethodSourceSinkDefinition.CallType callType)
Creates a source definition that considers the return value as tainted
|
boolean |
equals(Object obj) |
MethodSourceSinkDefinition |
filter(Collection<AccessPathTuple> accessPaths)
Filters the source/sink definition to only reference the given access paths
|
Set<AccessPathTuple> |
getAllAccessPaths()
Gets all access paths referenced in this source or sink definition,
regardless of their respective semantics
|
int |
getBaseObjectCount()
Gets the number of access paths defined as sources or sinks on base objects
|
Set<AccessPathTuple> |
getBaseObjects()
Gets the source and sink definitions for the base object on which a method of
this class is invoked
|
MethodSourceSinkDefinition |
getBaseObjectSink()
Gets the shared sink definition that is not associated with any method and
taints the base object
|
MethodSourceSinkDefinition |
getBaseObjectSource()
Gets the shared source definition that is not associated with any method and
taints the base object
|
MethodSourceSinkDefinition.CallType |
getCallType()
Gets the type of method invocations that are denoted by this source or sink
|
SootMethodAndClass |
getMethod()
Gets the method for which this object defines sources and sinks
|
int |
getParameterCount()
Gets the number of access paths defined as sources or sinks on parameters
|
Set<AccessPathTuple>[] |
getParameters()
Gets the source and sink definitions for parameters of the current method
|
int |
getReturnValueCount()
Gets the number of access paths defined as sources or sinks on return values
|
Set<AccessPathTuple> |
getReturnValues()
Gets the source definitions for the return value of the current method
|
MethodSourceSinkDefinition |
getSinkOnlyDefinition()
Creates a definition which is a subset of this definition that only contains
the sinks
|
MethodSourceSinkDefinition |
getSourceOnlyDefinition()
Creates a definition which is a subset of this definition that only contains
the sources
|
int |
hashCode() |
boolean |
isEmpty()
Checks whether this source/sink definition is empty, i.e., has no concrete
access paths
|
void |
merge(ISourceSinkDefinition other)
Merges the source and sink definitions of the given definition object into
this definition object
|
MethodSourceSinkDefinition |
simplify()
Checks whether this definition is equivalent to one of the simple predefined
ones.
|
String |
toString() |
getCategory, setCategoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCategory, setCategoryprotected final SootMethodAndClass method
protected final MethodSourceSinkDefinition.CallType callType
protected Set<AccessPathTuple> baseObjects
protected Set<AccessPathTuple>[] parameters
protected Set<AccessPathTuple> returnValues
public MethodSourceSinkDefinition(Set<AccessPathTuple> baseObjects, Set<AccessPathTuple>[] parameters, Set<AccessPathTuple> returnValues, MethodSourceSinkDefinition.CallType callType)
MethodSourceSinkDefinition class
without a method. This constructor is intended to be used for sources that
arise from UI elements or other programming constructs that are not directly
associated with a single method being called.public MethodSourceSinkDefinition(SootMethodAndClass am)
MethodSourceSinkDefinition classam - The method for which this object defines sources and sinkspublic MethodSourceSinkDefinition(SootMethodAndClass am, MethodSourceSinkDefinition.CallType callType)
MethodSourceSinkDefinition classam - The method for which this object defines sources and sinkscallType - The type of calls to define as sources or sinkspublic MethodSourceSinkDefinition(SootMethodAndClass am, Set<AccessPathTuple> baseObjects, Set<AccessPathTuple>[] parameters, Set<AccessPathTuple> returnValues, MethodSourceSinkDefinition.CallType callType)
am - The method for which this object defines sources and
sinksbaseObjects - The source and sink definitions for the base object on
which a method of this class is invokedparameters - The source and sink definitions for parameters of the
current methodcallType - The type of calls to define as sources or sinksreturnValues - The source definitions for the return value of the
current methodpublic SootMethodAndClass getMethod()
public MethodSourceSinkDefinition.CallType getCallType()
public Set<AccessPathTuple> getBaseObjects()
public int getBaseObjectCount()
public Set<AccessPathTuple>[] getParameters()
public int getParameterCount()
public Set<AccessPathTuple> getReturnValues()
public int getReturnValueCount()
public boolean isEmpty()
IAccessPathBasedSourceSinkDefinitionisEmpty in interface IAccessPathBasedSourceSinkDefinitionpublic MethodSourceSinkDefinition getSourceOnlyDefinition()
IAccessPathBasedSourceSinkDefinitiongetSourceOnlyDefinition in interface IAccessPathBasedSourceSinkDefinitiongetSourceOnlyDefinition in interface ISourceSinkDefinitionpublic MethodSourceSinkDefinition getSinkOnlyDefinition()
IAccessPathBasedSourceSinkDefinitiongetSinkOnlyDefinition in interface IAccessPathBasedSourceSinkDefinitiongetSinkOnlyDefinition in interface ISourceSinkDefinitionprotected MethodSourceSinkDefinition buildNewDefinition(Set<AccessPathTuple> baseAPTs, Set<AccessPathTuple>[] paramAPTs, Set<AccessPathTuple> returnAPTs)
baseAPTs - The access paths rooted in the base objectparamAPTs - The access paths rooted in the method's parametersreturnAPTs - The access paths rooted in the return valueprotected MethodSourceSinkDefinition buildNewDefinition(SootMethodAndClass methodAndclass, Set<AccessPathTuple> filteredBaseObjects, Set<AccessPathTuple>[] filteredParameters, Set<AccessPathTuple> filteredReturnValues, MethodSourceSinkDefinition.CallType callType)
public void merge(ISourceSinkDefinition other)
ISourceSinkDefinitionmerge in interface ISourceSinkDefinitionother - The definition object to mergepublic void addParameterDefinition(int paramIdx,
Set<AccessPathTuple> paramDefs)
paramIdx - The parameter indexparamDefs - The access path tuplespublic MethodSourceSinkDefinition getBaseObjectSource()
public MethodSourceSinkDefinition getBaseObjectSink()
public int hashCode()
hashCode in class AbstractSourceSinkDefinitionpublic boolean equals(Object obj)
equals in class AbstractSourceSinkDefinitionpublic static MethodSourceSinkDefinition createParameterSource(int index, MethodSourceSinkDefinition.CallType callType)
index - The index of the parameter to consider as taintedcallType - The type of callpublic static MethodSourceSinkDefinition createReturnSource(MethodSourceSinkDefinition.CallType callType)
callType - The type of callpublic MethodSourceSinkDefinition simplify()
public Set<AccessPathTuple> getAllAccessPaths()
IAccessPathBasedSourceSinkDefinitiongetAllAccessPaths in interface IAccessPathBasedSourceSinkDefinitionpublic MethodSourceSinkDefinition filter(Collection<AccessPathTuple> accessPaths)
IAccessPathBasedSourceSinkDefinitionfilter in interface IAccessPathBasedSourceSinkDefinitionaccessPaths - The access path to which to limit the scope of this
source/sink definitionCopyright © 2021 Fraunhofer SIT. All rights reserved.