Skip to content

Commit 0c6957e

Browse files
committed
Adjust test expectations of a query affected by new summaries
1 parent f4047e0 commit 0c6957e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

swift/ql/test/query-tests/Security/CWE-311/CleartextTransmission.expected

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
edges
2+
| testSend.swift:5:5:5:29 | [summary param] 0 in init(_:) : | file://:0:0:0:0 | [summary] to write: return (return) in init(_:) : |
3+
| testSend.swift:33:14:33:32 | call to init(_:) : | testSend.swift:37:19:37:19 | data2 |
4+
| testSend.swift:33:19:33:19 | passwordPlain : | testSend.swift:5:5:5:29 | [summary param] 0 in init(_:) : |
5+
| testSend.swift:33:19:33:19 | passwordPlain : | testSend.swift:33:14:33:32 | call to init(_:) : |
26
| testSend.swift:41:10:41:18 | data : | testSend.swift:41:45:41:45 | data : |
37
| testSend.swift:45:13:45:13 | password : | testSend.swift:52:27:52:27 | str1 |
48
| testSend.swift:46:13:46:13 | password : | testSend.swift:53:27:53:27 | str2 |
@@ -8,7 +12,12 @@ edges
812
| testURL.swift:13:54:13:54 | passwd : | testURL.swift:13:22:13:54 | ... .+(_:_:) ... |
913
| testURL.swift:16:55:16:55 | credit_card_no : | testURL.swift:16:22:16:55 | ... .+(_:_:) ... |
1014
nodes
15+
| file://:0:0:0:0 | [summary] to write: return (return) in init(_:) : | semmle.label | [summary] to write: return (return) in init(_:) : |
16+
| testSend.swift:5:5:5:29 | [summary param] 0 in init(_:) : | semmle.label | [summary param] 0 in init(_:) : |
1117
| testSend.swift:29:19:29:19 | passwordPlain | semmle.label | passwordPlain |
18+
| testSend.swift:33:14:33:32 | call to init(_:) : | semmle.label | call to init(_:) : |
19+
| testSend.swift:33:19:33:19 | passwordPlain : | semmle.label | passwordPlain : |
20+
| testSend.swift:37:19:37:19 | data2 | semmle.label | data2 |
1221
| testSend.swift:41:10:41:18 | data : | semmle.label | data : |
1322
| testSend.swift:41:45:41:45 | data : | semmle.label | data : |
1423
| testSend.swift:45:13:45:13 | password : | semmle.label | password : |
@@ -24,9 +33,11 @@ nodes
2433
| testURL.swift:16:55:16:55 | credit_card_no : | semmle.label | credit_card_no : |
2534
| testURL.swift:20:22:20:22 | passwd | semmle.label | passwd |
2635
subpaths
36+
| testSend.swift:33:19:33:19 | passwordPlain : | testSend.swift:5:5:5:29 | [summary param] 0 in init(_:) : | file://:0:0:0:0 | [summary] to write: return (return) in init(_:) : | testSend.swift:33:14:33:32 | call to init(_:) : |
2737
| testSend.swift:47:17:47:17 | password : | testSend.swift:41:10:41:18 | data : | testSend.swift:41:45:41:45 | data : | testSend.swift:47:13:47:25 | call to pad(_:) : |
2838
#select
2939
| testSend.swift:29:19:29:19 | passwordPlain | testSend.swift:29:19:29:19 | passwordPlain | testSend.swift:29:19:29:19 | passwordPlain | This operation transmits 'passwordPlain', which may contain unencrypted sensitive data from $@. | testSend.swift:29:19:29:19 | passwordPlain | passwordPlain |
40+
| testSend.swift:37:19:37:19 | data2 | testSend.swift:33:19:33:19 | passwordPlain : | testSend.swift:37:19:37:19 | data2 | This operation transmits 'data2', which may contain unencrypted sensitive data from $@. | testSend.swift:33:19:33:19 | passwordPlain : | passwordPlain |
3041
| testSend.swift:52:27:52:27 | str1 | testSend.swift:45:13:45:13 | password : | testSend.swift:52:27:52:27 | str1 | This operation transmits 'str1', which may contain unencrypted sensitive data from $@. | testSend.swift:45:13:45:13 | password : | password |
3142
| testSend.swift:53:27:53:27 | str2 | testSend.swift:46:13:46:13 | password : | testSend.swift:53:27:53:27 | str2 | This operation transmits 'str2', which may contain unencrypted sensitive data from $@. | testSend.swift:46:13:46:13 | password : | password |
3243
| testSend.swift:54:27:54:27 | str3 | testSend.swift:47:17:47:17 | password : | testSend.swift:54:27:54:27 | str3 | This operation transmits 'str3', which may contain unencrypted sensitive data from $@. | testSend.swift:47:17:47:17 | password : | password |

swift/ql/test/query-tests/Security/CWE-311/testSend.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func test1(passwordPlain : String, passwordHash : String) {
3434
let data3 = Data(passwordHash)
3535

3636
nw.send(content: data1, completion: .idempotent) // GOOD (not sensitive)
37-
nw.send(content: data2, completion: .idempotent) // BAD [NOT DETECTED]
37+
nw.send(content: data2, completion: .idempotent) // BAD
3838
nw.send(content: data3, completion: .idempotent) // GOOD (not sensitive)
3939
}
4040

0 commit comments

Comments
 (0)