Skip to content

Commit beb7d9d

Browse files
committed
Swift: Test layout change.
1 parent f5a2853 commit beb7d9d

File tree

3 files changed

+51
-44
lines changed

3 files changed

+51
-44
lines changed

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,19 @@ edges
168168
| testGRDB.swift:208:81:208:81 | password : | testGRDB.swift:208:80:208:89 | [...] |
169169
| testGRDB.swift:210:85:210:85 | password : | testGRDB.swift:210:84:210:93 | [...] |
170170
| testGRDB.swift:212:99:212:99 | password : | testGRDB.swift:212:98:212:107 | [...] |
171-
| testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | value : |
172-
| testRealm.swift:34:2:34:2 | [post] a [data] : | testRealm.swift:34:2:34:2 | [post] a |
173-
| testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:16:6:16:6 | value : |
174-
| testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:34:2:34:2 | [post] a [data] : |
175-
| testRealm.swift:42:2:42:2 | [post] c [data] : | testRealm.swift:42:2:42:2 | [post] c |
176-
| testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:16:6:16:6 | value : |
177-
| testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:42:2:42:2 | [post] c [data] : |
178-
| testRealm.swift:52:2:52:3 | [post] ...! [data] : | testRealm.swift:52:2:52:3 | [post] ...! |
179-
| testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:16:6:16:6 | value : |
180-
| testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:52:2:52:3 | [post] ...! [data] : |
181-
| testRealm.swift:59:2:59:2 | [post] g [data] : | testRealm.swift:59:2:59:2 | [post] g |
182-
| testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:16:6:16:6 | value : |
183-
| testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:59:2:59:2 | [post] g [data] : |
171+
| testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | value : |
172+
| testRealm.swift:41:2:41:2 | [post] a [data] : | testRealm.swift:41:2:41:2 | [post] a |
173+
| testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:27:6:27:6 | value : |
174+
| testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:41:2:41:2 | [post] a [data] : |
175+
| testRealm.swift:49:2:49:2 | [post] c [data] : | testRealm.swift:49:2:49:2 | [post] c |
176+
| testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:27:6:27:6 | value : |
177+
| testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:49:2:49:2 | [post] c [data] : |
178+
| testRealm.swift:59:2:59:3 | [post] ...! [data] : | testRealm.swift:59:2:59:3 | [post] ...! |
179+
| testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:27:6:27:6 | value : |
180+
| testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:59:2:59:3 | [post] ...! [data] : |
181+
| testRealm.swift:66:2:66:2 | [post] g [data] : | testRealm.swift:66:2:66:2 | [post] g |
182+
| testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:27:6:27:6 | value : |
183+
| testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:66:2:66:2 | [post] g [data] : |
184184
nodes
185185
| file://:0:0:0:0 | .value2 : | semmle.label | .value2 : |
186186
| file://:0:0:0:0 | .value : | semmle.label | .value : |
@@ -421,19 +421,19 @@ nodes
421421
| testGRDB.swift:210:85:210:85 | password : | semmle.label | password : |
422422
| testGRDB.swift:212:98:212:107 | [...] | semmle.label | [...] |
423423
| testGRDB.swift:212:99:212:99 | password : | semmle.label | password : |
424-
| testRealm.swift:16:6:16:6 | value : | semmle.label | value : |
425-
| testRealm.swift:34:2:34:2 | [post] a | semmle.label | [post] a |
426-
| testRealm.swift:34:2:34:2 | [post] a [data] : | semmle.label | [post] a [data] : |
427-
| testRealm.swift:34:11:34:11 | myPassword : | semmle.label | myPassword : |
428-
| testRealm.swift:42:2:42:2 | [post] c | semmle.label | [post] c |
429-
| testRealm.swift:42:2:42:2 | [post] c [data] : | semmle.label | [post] c [data] : |
430-
| testRealm.swift:42:11:42:11 | myPassword : | semmle.label | myPassword : |
431-
| testRealm.swift:52:2:52:3 | [post] ...! | semmle.label | [post] ...! |
432-
| testRealm.swift:52:2:52:3 | [post] ...! [data] : | semmle.label | [post] ...! [data] : |
433-
| testRealm.swift:52:12:52:12 | myPassword : | semmle.label | myPassword : |
434-
| testRealm.swift:59:2:59:2 | [post] g | semmle.label | [post] g |
435-
| testRealm.swift:59:2:59:2 | [post] g [data] : | semmle.label | [post] g [data] : |
436-
| testRealm.swift:59:11:59:11 | myPassword : | semmle.label | myPassword : |
424+
| testRealm.swift:27:6:27:6 | value : | semmle.label | value : |
425+
| testRealm.swift:41:2:41:2 | [post] a | semmle.label | [post] a |
426+
| testRealm.swift:41:2:41:2 | [post] a [data] : | semmle.label | [post] a [data] : |
427+
| testRealm.swift:41:11:41:11 | myPassword : | semmle.label | myPassword : |
428+
| testRealm.swift:49:2:49:2 | [post] c | semmle.label | [post] c |
429+
| testRealm.swift:49:2:49:2 | [post] c [data] : | semmle.label | [post] c [data] : |
430+
| testRealm.swift:49:11:49:11 | myPassword : | semmle.label | myPassword : |
431+
| testRealm.swift:59:2:59:3 | [post] ...! | semmle.label | [post] ...! |
432+
| testRealm.swift:59:2:59:3 | [post] ...! [data] : | semmle.label | [post] ...! [data] : |
433+
| testRealm.swift:59:12:59:12 | myPassword : | semmle.label | myPassword : |
434+
| testRealm.swift:66:2:66:2 | [post] g | semmle.label | [post] g |
435+
| testRealm.swift:66:2:66:2 | [post] g [data] : | semmle.label | [post] g [data] : |
436+
| testRealm.swift:66:11:66:11 | myPassword : | semmle.label | myPassword : |
437437
subpaths
438438
| testCoreData2.swift:43:35:43:35 | bankAccountNo : | testCoreData2.swift:23:13:23:13 | value : | file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] : | testCoreData2.swift:43:2:43:2 | [post] obj [notStoredBankAccountNumber] : |
439439
| testCoreData2.swift:52:41:52:41 | bankAccountNo : | testCoreData2.swift:23:13:23:13 | value : | file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] : | testCoreData2.swift:52:2:52:10 | [post] ...? [notStoredBankAccountNumber] : |
@@ -449,10 +449,10 @@ subpaths
449449
| testCoreData2.swift:98:18:98:18 | d [value] : | testCoreData2.swift:70:9:70:9 | self [value] : | file://:0:0:0:0 | .value : | testCoreData2.swift:98:18:98:20 | .value : |
450450
| testCoreData2.swift:104:18:104:18 | e : | testCoreData2.swift:70:9:70:9 | self : | file://:0:0:0:0 | .value : | testCoreData2.swift:104:18:104:20 | .value : |
451451
| testCoreData2.swift:105:18:105:18 | e : | testCoreData2.swift:71:9:71:9 | self : | file://:0:0:0:0 | .value2 : | testCoreData2.swift:105:18:105:20 | .value2 : |
452-
| testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:34:2:34:2 | [post] a [data] : |
453-
| testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:42:2:42:2 | [post] c [data] : |
454-
| testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:52:2:52:3 | [post] ...! [data] : |
455-
| testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:59:2:59:2 | [post] g [data] : |
452+
| testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:41:2:41:2 | [post] a [data] : |
453+
| testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:49:2:49:2 | [post] c [data] : |
454+
| testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:59:2:59:3 | [post] ...! [data] : |
455+
| testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:66:2:66:2 | [post] g [data] : |
456456
#select
457457
| testCoreData2.swift:37:2:37:2 | obj | testCoreData2.swift:37:16:37:16 | bankAccountNo : | testCoreData2.swift:37:2:37:2 | [post] obj | This operation stores 'obj' in a database. It may contain unencrypted sensitive data from $@. | testCoreData2.swift:37:16:37:16 | bankAccountNo : | bankAccountNo |
458458
| testCoreData2.swift:39:2:39:2 | obj | testCoreData2.swift:39:28:39:28 | bankAccountNo : | testCoreData2.swift:39:2:39:2 | [post] obj | This operation stores 'obj' in a database. It may contain unencrypted sensitive data from $@. | testCoreData2.swift:39:28:39:28 | bankAccountNo : | bankAccountNo |
@@ -542,7 +542,7 @@ subpaths
542542
| testGRDB.swift:208:80:208:89 | [...] | testGRDB.swift:208:81:208:81 | password : | testGRDB.swift:208:80:208:89 | [...] | This operation stores '[...]' in a database. It may contain unencrypted sensitive data from $@. | testGRDB.swift:208:81:208:81 | password : | password |
543543
| testGRDB.swift:210:84:210:93 | [...] | testGRDB.swift:210:85:210:85 | password : | testGRDB.swift:210:84:210:93 | [...] | This operation stores '[...]' in a database. It may contain unencrypted sensitive data from $@. | testGRDB.swift:210:85:210:85 | password : | password |
544544
| testGRDB.swift:212:98:212:107 | [...] | testGRDB.swift:212:99:212:99 | password : | testGRDB.swift:212:98:212:107 | [...] | This operation stores '[...]' in a database. It may contain unencrypted sensitive data from $@. | testGRDB.swift:212:99:212:99 | password : | password |
545-
| testRealm.swift:34:2:34:2 | a | testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:34:2:34:2 | [post] a | This operation stores 'a' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:34:11:34:11 | myPassword : | myPassword |
546-
| testRealm.swift:42:2:42:2 | c | testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:42:2:42:2 | [post] c | This operation stores 'c' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:42:11:42:11 | myPassword : | myPassword |
547-
| testRealm.swift:52:2:52:3 | ...! | testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:52:2:52:3 | [post] ...! | This operation stores '...!' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:52:12:52:12 | myPassword : | myPassword |
548-
| testRealm.swift:59:2:59:2 | g | testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:59:2:59:2 | [post] g | This operation stores 'g' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:59:11:59:11 | myPassword : | myPassword |
545+
| testRealm.swift:41:2:41:2 | a | testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:41:2:41:2 | [post] a | This operation stores 'a' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:41:11:41:11 | myPassword : | myPassword |
546+
| testRealm.swift:49:2:49:2 | c | testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:49:2:49:2 | [post] c | This operation stores 'c' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:49:11:49:11 | myPassword : | myPassword |
547+
| testRealm.swift:59:2:59:3 | ...! | testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:59:2:59:3 | [post] ...! | This operation stores '...!' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:59:12:59:12 | myPassword : | myPassword |
548+
| testRealm.swift:66:2:66:2 | g | testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:66:2:66:2 | [post] g | This operation stores 'g' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:66:11:66:11 | myPassword : | myPassword |

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@
111111
| testGRDB.swift:208:81:208:81 | password | label:password, type:credential |
112112
| testGRDB.swift:210:85:210:85 | password | label:password, type:credential |
113113
| testGRDB.swift:212:99:212:99 | password | label:password, type:credential |
114-
| testRealm.swift:34:11:34:11 | myPassword | label:myPassword, type:credential |
115-
| testRealm.swift:42:11:42:11 | myPassword | label:myPassword, type:credential |
116-
| testRealm.swift:52:12:52:12 | myPassword | label:myPassword, type:credential |
117-
| testRealm.swift:59:11:59:11 | myPassword | label:myPassword, type:credential |
114+
| testRealm.swift:41:11:41:11 | myPassword | label:myPassword, type:credential |
115+
| testRealm.swift:49:11:49:11 | myPassword | label:myPassword, type:credential |
116+
| testRealm.swift:59:12:59:12 | myPassword | label:myPassword, type:credential |
117+
| testRealm.swift:66:11:66:11 | myPassword | label:myPassword, type:credential |
118118
| testSend.swift:29:19:29:19 | passwordPlain | label:passwordPlain, type:credential |
119119
| testSend.swift:33:19:33:19 | passwordPlain | label:passwordPlain, type:credential |
120120
| testSend.swift:45:13:45:13 | password | label:password, type:credential |

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ class RealmSwiftObject {
1010

1111
typealias Object = RealmSwiftObject
1212

13-
class MyRealmSwiftObject : RealmSwiftObject {
14-
override init() { data = "" }
15-
16-
var data: String
17-
}
18-
1913
class Realm {
2014
func add(_ object: Object, update: UpdatePolicy = .error) {}
2115

@@ -27,6 +21,19 @@ class Realm {
2721

2822
// --- tests ---
2923

24+
class MyRealmSwiftObject : RealmSwiftObject {
25+
override init() { data = "" }
26+
27+
var data: String
28+
}
29+
30+
31+
32+
33+
34+
35+
36+
3037
func test1(realm : Realm, myPassword : String, myHashedPassword : String) {
3138
// add objects (within a transaction) ...
3239

0 commit comments

Comments
 (0)