aboutsummaryrefslogtreecommitdiff
path: root/xacml-proofs/compiler/bin/main.ml
diff options
context:
space:
mode:
Diffstat (limited to 'xacml-proofs/compiler/bin/main.ml')
-rw-r--r--xacml-proofs/compiler/bin/main.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/xacml-proofs/compiler/bin/main.ml b/xacml-proofs/compiler/bin/main.ml
index 9d1cce4..5df7864 100644
--- a/xacml-proofs/compiler/bin/main.ml
+++ b/xacml-proofs/compiler/bin/main.ml
@@ -1,5 +1,7 @@
open Base
+let version_regex = Str.regexp "^\\([0-9]+\\.\\)*[0-9]+$"
+
let policy = {|<?xml version="1.0" encoding="UTF-8"?>
<Policy
xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
@@ -397,6 +399,7 @@ let compile_policy (elt : xml_element) : (lean_expression list) * lean_expressio
assert (String.equal tag_name "Policy");
let identifier = get_attr_exn "PolicyId" attrs in
let version = get_attr_exn "Version" attrs in
+ assert (Str.string_match version_regex version 0);
let variables =
List.fold (get_children "VariableDefinition" children)
~init:[]
@@ -435,6 +438,7 @@ let rec compile_policyset (elt : xml_element) : (lean_expression list) * lean_ex
assert (String.equal tag_name "Rule");
let identifier = get_attr_exn "PolicySetId" attrs in
let version = get_attr_exn "Version" attrs in
+ assert (Str.string_match version_regex version 0);
let obligation_expressions = get_children "ObligationExpression" children in
let advice_expressions = get_children "AdviceExpression" children in
let alg_id = get_attr_exn "PolicyCombiningAlgId" attrs in

© 2015 - 2026 Jakob L. Kreuze