ruby/python: implement shared module

ruby:
- create new shared file `SummaryTypeTracker.qll`
- move much logic into the module
- instantiate the module
- remove old logic, now provided by module

python:
- clone shared file
- instantiate module
- use (some of the) steps provided by the module
This commit is contained in:
Rasmus Lerchedahl Petersen
2023-05-16 14:20:29 +02:00
parent 47b2d48da2
commit 2daa9577bb
6 changed files with 1011 additions and 269 deletions

View File

@@ -3,7 +3,7 @@ import os
# Simple summary
tainted = identity(tracked) # $ tracked
tainted # $ MISSING: tracked
tainted # $ tracked
# Lambda summary
# I think the missing result is expected because type tracking
@@ -13,7 +13,7 @@ tainted_lambda # $ MISSING: tracked
# A lambda that directly introduces taint
bad_lambda = apply_lambda(lambda x: tracked, 1) # $ tracked
bad_lambda # $ MISSING: tracked
bad_lambda # $ tracked
# A lambda that breaks the flow
untainted_lambda = apply_lambda(lambda x: 1, tracked) # $ tracked
@@ -52,9 +52,9 @@ tr = tainted_resultlist[0]
tr # $ MISSING: tracked
x.secret = tracked # $ tracked=secret tracked
r = read_secret(x) # $ tracked=secret MISSING: tracked
r # $ MISSING: tracked
r = read_secret(x) # $ tracked=secret tracked
r # $ tracked
y # $ MISSING: tracked=secret
set_secret(y, tracked) # $ tracked MISSING: tracked=secret
y.secret # $ MISSING: tracked tracked=secret
y # $ tracked=secret
set_secret(y, tracked) # $ tracked tracked=secret
y.secret # $ tracked tracked=secret