2
2
import os
3
3
4
4
# Simple summary
5
- tainted = identity (tracked ) # $ tracked
5
+ tainted = TTS_identity (tracked ) # $ tracked
6
6
tainted # $ tracked
7
7
8
8
# Lambda summary
9
9
# I think the missing result is expected because type tracking
10
10
# is not allowed to flow back out of a call.
11
- tainted_lambda = apply_lambda (lambda x : x , tracked ) # $ tracked
11
+ tainted_lambda = TTS_apply_lambda (lambda x : x , tracked ) # $ tracked
12
12
tainted_lambda # $ MISSING: tracked
13
13
14
14
# A lambda that directly introduces taint
15
- bad_lambda = apply_lambda (lambda x : tracked , 1 ) # $ tracked
15
+ bad_lambda = TTS_apply_lambda (lambda x : tracked , 1 ) # $ tracked
16
16
bad_lambda # $ tracked
17
17
18
18
# A lambda that breaks the flow
19
- untainted_lambda = apply_lambda (lambda x : 1 , tracked ) # $ tracked
19
+ untainted_lambda = TTS_apply_lambda (lambda x : 1 , tracked ) # $ tracked
20
20
untainted_lambda
21
21
22
22
# Collection summaries
23
- tainted_list = reversed ([tracked ]) # $ tracked
23
+ tainted_list = TTS_reversed ([tracked ]) # $ tracked
24
24
tl = tainted_list [0 ]
25
25
tl # $ MISSING: tracked
26
26
27
27
# Complex summaries
28
28
def add_colon (x ):
29
29
return x + ":"
30
30
31
- tainted_mapped = list_map (add_colon , [tracked ]) # $ tracked
31
+ tainted_mapped = TTS_list_map (add_colon , [tracked ]) # $ tracked
32
32
tm = tainted_mapped [0 ]
33
33
tm # $ MISSING: tracked
34
34
35
35
def explicit_identity (x ):
36
36
return x
37
37
38
- tainted_mapped_explicit = list_map (explicit_identity , [tracked ]) # $ tracked
38
+ tainted_mapped_explicit = TTS_list_map (explicit_identity , [tracked ]) # $ tracked
39
39
tainted_mapped_explicit [0 ] # $ MISSING: tracked
40
40
41
- tainted_mapped_summary = list_map (identity , [tracked ]) # $ tracked
41
+ tainted_mapped_summary = TTS_list_map (identity , [tracked ]) # $ tracked
42
42
tms = tainted_mapped_summary [0 ]
43
43
tms # $ MISSING: tracked
44
44
45
- another_tainted_list = append_to_list ([], tracked ) # $ tracked
45
+ another_tainted_list = TTS_append_to_list ([], tracked ) # $ tracked
46
46
atl = another_tainted_list [0 ]
47
47
atl # $ MISSING: tracked
48
48
@@ -53,9 +53,9 @@ def explicit_identity(x):
53
53
tr # $ MISSING: tracked
54
54
55
55
x .secret = tracked # $ tracked=secret tracked
56
- r = read_secret (x ) # $ tracked=secret tracked
56
+ r = TTS_read_secret (x ) # $ tracked=secret tracked
57
57
r # $ tracked
58
58
59
59
y # $ tracked=secret
60
- set_secret (y , tracked ) # $ tracked tracked=secret
60
+ TTS_set_secret (y , tracked ) # $ tracked tracked=secret
61
61
y .secret # $ tracked tracked=secret
0 commit comments