------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2020, Frank Singhoff, Alain Plantec, Jerome Legrand, -- Hai Nam Tran, Stephane Rubini -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR CNRS 6285, Universite de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ------------------------------------------------------------------------------ -- Last update : -- $Rev$ -- $Date$ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with unbounded_strings; use unbounded_strings; with task_set; use task_set; with text_io; use text_io; with Xml_Tag; use Xml_Tag; with double_util; use double_util; with Translate; use Translate; with Ada.Numerics.Aux; use Ada.Numerics.Aux; with GNAT.Current_Exception; use GNAT.Current_Exception; with Framework_Config; use Framework_Config; with mils_analysis; use mils_analysis; with Debug; use Debug; with task_dependencies; use task_dependencies; use task_dependencies.Half_Dep_Set; with dependencies; use dependencies; package body call_security_framework is procedure Compute_MILS_security_biba (Sys : in System; Result : in out Unbounded_String; Output : in Output_Format := String_Output) is violation : Tasks_Dependencies_Ptr; number : integer :=0; My_Iterator : Tasks_Dependencies_Iterator; A_Half_Dep : Dependency_Ptr; begin Put_Debug ("Call Compute_MILS_security_biba"); result:=empty_string; if Output = Xml_Output then Set_Tag; else Set_Empty; end if; violation:=biba(Sys); if (violation /= null) then number:=integer(get_number_of_elements(violation.depends)); end if; Result := to_unbounded_string("- Biba analysis has detected ") & number'img ; if (number > 1) then result := result & to_unbounded_string(" violations in the model [25] :") & unbounded_lf; reset_iterator (violation.depends, My_Iterator); loop current_element (violation.depends, A_Half_Dep, My_Iterator); if A_Half_Dep.type_of_dependency = precedence_Dependency then result := result & " " & A_Half_Dep.precedence_source.name & "=>" & A_Half_Dep.precedence_sink.name & ASCII.LF; end if; exit when is_last_element (violation.depends, My_Iterator); next_element (violation.depends, My_Iterator); end loop; else result := result & to_unbounded_string(" violation in the model [25].") & unbounded_lf; end if; end Compute_MILS_security_biba; procedure Compute_MILS_security_bell_lapadula (Sys : in System; Result : in out Unbounded_String; Output : in Output_Format := String_Output) is violation : Tasks_Dependencies_Ptr; number : integer :=0; My_Iterator : Tasks_Dependencies_Iterator; A_Half_Dep : Dependency_Ptr; begin Put_Debug ("Call Compute_MILS_security_bel_lapadula"); result:=empty_string; if Output = Xml_Output then Set_Tag; else Set_Empty; end if; violation:=bell_lapadula(Sys); if (violation /= null) then number:=integer(get_number_of_elements(violation.depends)); end if; Result := to_unbounded_string("- Bell/La Padula analysis has detected ") & number'img ; if (number > 1) then result := result & to_unbounded_string(" violations in the model [24] :") & unbounded_lf; reset_iterator (violation.depends, My_Iterator); loop current_element (violation.depends, A_Half_Dep, My_Iterator); if A_Half_Dep.type_of_dependency = precedence_Dependency then result := result & " " & A_Half_Dep.precedence_source.name & "=>" & A_Half_Dep.precedence_sink.name & ASCII.LF; end if; exit when is_last_element (violation.depends, My_Iterator); next_element (violation.depends, My_Iterator); end loop; else result := result & to_unbounded_string(" violation in the model [24].") & unbounded_lf; end if; end Compute_MILS_security_bell_lapadula; procedure Compute_MILS_security_chinese_wall (Sys : in System; Result : in out Unbounded_String; Output : in Output_Format := String_Output) is begin null; end Compute_MILS_security_chinese_wall; procedure Compute_MILS_security_warshall (Sys : in System; Result : in out Unbounded_String; Output : in Output_Format := String_Output) is begin null; end Compute_MILS_security_warshall; end call_security_framework;