/*public static List<O2Finding> glueSinksToSources(O2Assessment o2AssessmentWithSinks, O2Assessment o2AssessmentWithSources) * { * var webLayerSources = getO2StringIndexes(webLayer, TraceType.Source); * * foreach (var clickButtonFinding in clickButton.o2Findings) * { * results.Add(clickButtonFinding); * var sink = OzasmtUtils.getKnownSink(clickButtonFinding.o2Trace); * PublicDI.log.debug(sink.signature); * if (webLayerSources.ContainsKey(sink.signature)) * foreach (var webLayerSource in webLayerSources[sink.signature]) * { * results.Add(OzasmtGlue.createCopyAndGlueTraceAndSink(clickButtonFinding, * OzasmtUtils.getSource( * webLayerSource.o2Trace))); * /*var o2NewFinding = OzasmtCopy.createCopy(clickButtonFinding); * var newFindingSink = OzasmtUtils.getKnownSink(o2NewFinding.o2Trace); * newFindingSink.traceType = TraceType.Type_4; * var sourceToGlue = OzasmtCopy.createCopy(OzasmtUtils.getSource(webLayerSource.o2Trace)); * sourceToGlue.traceType = TraceType.Type_0; * newFindingSink.childTraces.Add(sourceToGlue); * results.Add(o2NewFinding);*/ /* } * }*/ public static IO2Finding createCopyAndGlueTraceSinkWithSource(IO2Finding o2TemplateFinding, IO2Trace o2TraceWithSource) { IO2Trace sourceToGlue = OzasmtCopy.createCopy(OzasmtUtils.getSource(o2TraceWithSource)); return(createCopyAndGlueTraceSinkWithTrace(o2TemplateFinding, sourceToGlue)); }
public static IO2Finding createCopyAndGlueTraceSinkWithTrace(IO2Finding o2TemplateFinding, List <IO2Trace> o2TracesToGlue) { IO2Finding o2NewFinding = OzasmtCopy.createCopy(o2TemplateFinding); //IO2Trace newFindingSink = OzasmtUtils.getKnownSink(o2NewFinding.o2Traces); IO2Trace newFindingSink = OzasmtUtils.getSink(o2NewFinding.o2Traces); newFindingSink.traceType = TraceType.Root_Call; foreach (O2Trace o2TraceToGlue in o2TracesToGlue) { o2TraceToGlue.traceType = TraceType.Root_Call; newFindingSink.childTraces.Add(o2TraceToGlue); } return(o2NewFinding); }
public static IO2Finding createO2FindingFromTrace(IO2Trace o2Trace) { var o2Finding = new O2Finding(); o2Finding.vulnType = "FindingFromTrace"; o2Finding.vulnName = o2Trace.signature; o2Finding.text = OzasmtCopy.createCopy(o2Trace.text); o2Finding.ordinal = o2Trace.ordinal; o2Finding.o2Traces = new List <IO2Trace>().add(OzasmtCopy.createCopy(o2Trace)); o2Finding.lineNumber = o2Trace.lineNumber; o2Finding.file = o2Trace.file; o2Finding.columnNumber = o2Trace.columnNumber; o2Finding.context = o2Trace.context; o2Finding.callerName = o2Trace.signature; return(o2Finding); }