changeset 233:b295826e28d3

... and into secret_annotator
author Sigurd Meldgaard <stm@daimi.au.dk>
date Mon, 04 Jan 2010 14:07:30 +0100
parents 3a5b4f442381
children b229f5b732c9
files pysmcl/secret_annotator.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/secret_annotator.py	Mon Jan 04 14:06:48 2010 +0100
+++ b/pysmcl/secret_annotator.py	Mon Jan 04 14:07:30 2010 +0100
@@ -6,7 +6,7 @@
 
 secret_functions = set(["get"])
 
-annotated_functions = set(["get"])
+annotated_functions = {}
 
 analysis_key = "secret"
 
@@ -130,8 +130,15 @@
         for keyword in decorator.keywords:
             if keyword.arg == 'secrets':
                 secrets = set(ast.literal_eval(keyword.value))
+                function.args_secret = []
+                for arg in function.args.args:
+                    function.args_secret.append(arg.id in secrets)
                 break
     function.body[0].imported_secrets = secrets
     pysmcl.flow.analyze(function, secret_join,
                         secret_combine, analysis_key, set())
     non_compromising_functions.add(function.name)
+
+    annotated_functions[function.name]=function
+    if(returns_secret(function)):
+        secret_functions.add(function.name)