Refactor output artifact type

This commit is contained in:
Nicolas Will
2025-04-02 19:44:57 +02:00
parent bec69ca106
commit 50507586ac
3 changed files with 24 additions and 53 deletions

View File

@@ -419,7 +419,7 @@ module JCAModel {
src.asExpr() instanceof CipherGetInstanceCall
}
predicate isSink(DataFlow::Node sink, FlowState state) { none() }
predicate isSink(DataFlow::Node sink, FlowState state) { none() } // TODO: document this, but this is intentional (avoid cross products?)
predicate isSink(DataFlow::Node sink) {
exists(CipherOperationCall c | c.getQualifier() = sink.asExpr())
@@ -786,7 +786,7 @@ module JCAModel {
type instanceof Crypto::TAsymmetricKeyType
}
override DataFlow::Node getOutputKeyArtifact() { result.asExpr() = this }
override Crypto::ArtifactOutputDataFlowNode getOutputKeyArtifact() { result.asExpr() = this }
override Crypto::KeyArtifactType getOutputKeyType() { result = type }
@@ -1139,7 +1139,7 @@ module JCAModel {
result.asExpr() = this.getInstantiation().getIterationCountArg()
}
override DataFlow::Node getOutputKeyArtifact() {
override Crypto::ArtifactOutputDataFlowNode getOutputKeyArtifact() {
result.asExpr() = this and
super.getMethod().getReturnType().hasName("SecretKey")
}

View File

@@ -191,19 +191,5 @@ module ArtifactUniversalFlowConfig implements DataFlow::ConfigSig {
module GenericDataSourceUniversalFlow = TaintTracking::Global<GenericDataSourceUniversalFlowConfig>;
/*
* class LiteralOrGenericDataSource extends Element {
* DataFlow::Node node;
*
* LiteralOrGenericDataSource() {
* node = this.(Crypto::GenericSourceInstance).getOutputNode() or
* node.asExpr() = this.(Literal)
* }
*
* bindingset[other]
* predicate localFlowsTo(DataFlow::Node other) { DataFlow::localFlow(node, other) }
* }
*/
// Import library-specific modeling
import JCA