Skip to content

Commit

Permalink
Merge pull request diffblue#218 from trtikm/PR_03
Browse files Browse the repository at this point in the history
Making the security analyser sensitive to "DUMP" configuration
  • Loading branch information
marek-trtik authored and smowton committed Mar 1, 2017
1 parent 6f3389d commit d841a18
Showing 1 changed file with 59 additions and 51 deletions.
110 changes: 59 additions & 51 deletions src/goto-analyzer/taint_security_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,48 +122,53 @@ bool taint_do_security_scan(
&statistics,
&logger);

logger.status()
<< "Saving analysed GOTO program in HTML format (see '"
<< fileutl_concatenate_file_paths(
config.get_output_root_directory(),
"goto-program/HTML/index.html")
<< "')." << messaget::eom;

dump_goto_program_in_html(
program.get_model(),
program.get_call_graph(),
fileutl_concatenate_file_paths(
config.get_output_root_directory(),
"goto-program/HTML"));

statistics.begin_dump_of_taint_html_summaries();

logger.status()
<< "Saving summaries of TAINT analysis in HTML format (see "
<< fileutl_concatenate_file_paths(
config.get_taint_summaries_root_directory(),
"HTML/index.html")
<< "')." << messaget::eom;

dump_in_html(
taint_summaries,
[&program,&numbering, &transition_rules, &named_tokens]
(const object_summaryt obj, const goto_modelt &, std::ostream &ostr)
-> std::string
{
taint_functions_for_dumping_taint_summary_in_htmlt
dump_fns(program, numbering, named_tokens);
return dump_fns.taint_object_summary_dump_as_html(obj,false,ostr);
},
program.get_model(),
program.get_call_graph(),
fileutl_concatenate_file_paths(
config.get_taint_summaries_root_directory(),
"HTML"),
false);
if(config.is_html_dump_of_program_enabled())
{
logger.status()
<< "Saving analysed GOTO program in HTML format (see '"
<< fileutl_concatenate_file_paths(
config.get_output_root_directory(),
"goto-program/HTML/index.html")
<< "')." << messaget::eom;

dump_goto_program_in_html(
program.get_model(),
program.get_call_graph(),
fileutl_concatenate_file_paths(
config.get_output_root_directory(),
"goto-program/HTML"));
}

statistics.end_dump_of_taint_html_summaries();
if(config.is_html_dump_of_summaries_enabled())
{
statistics.begin_dump_of_taint_html_summaries();

logger.status()
<< "Saving summaries of TAINT analysis in HTML format (see "
<< fileutl_concatenate_file_paths(
config.get_taint_summaries_root_directory(),
"HTML/index.html")
<< "')." << messaget::eom;

dump_in_html(
taint_summaries,
[&program,&numbering, &transition_rules, &named_tokens]
(const object_summaryt obj, const goto_modelt &, std::ostream &ostr)
-> std::string
{
taint_functions_for_dumping_taint_summary_in_htmlt
dump_fns(program, numbering, named_tokens);
return dump_fns.taint_object_summary_dump_as_html(obj,false,ostr);
},
program.get_model(),
program.get_call_graph(),
fileutl_concatenate_file_paths(
config.get_taint_summaries_root_directory(),
"HTML"),
false);

statistics.end_dump_of_taint_html_summaries();
}

logger.status()
<< "Saving summaries of TAINT analysis in JSON format (see "
Expand All @@ -183,18 +188,21 @@ bool taint_do_security_scan(

lvsa_summaries.save_all();

logger.status()
<< "Saving statistics of the whole analysis in HTML format (see "
<< fileutl_concatenate_file_paths(
config.get_statistics_root_directory(),
"HTML/index.html")
<< "')." << messaget::eom;
if(config.is_html_dump_of_statistics_enabled())
{
logger.status()
<< "Saving statistics of the whole analysis in HTML format (see "
<< fileutl_concatenate_file_paths(
config.get_statistics_root_directory(),
"HTML/index.html")
<< "')." << messaget::eom;

taint_dump_statistics_in_HTML(
statistics,
fileutl_concatenate_file_paths(
config.get_statistics_root_directory(),
"HTML"));
taint_dump_statistics_in_HTML(
statistics,
fileutl_concatenate_file_paths(
config.get_statistics_root_directory(),
"HTML"));
}

logger.status()
<< "Saving statistics of the whole analysis in JSON format (see "
Expand Down

0 comments on commit d841a18

Please sign in to comment.