Skip to content

Commit bcca18d

Browse files
authored
Merge pull request github#12638 from geoffw0/testfix
Swift: Accept test regressions
2 parents 081d97f + a4e9d38 commit bcca18d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

swift/ql/src/queries/Security/CWE-259/ConstantPassword.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class ConstantPasswordSink extends Expr {
3333
ConstantPasswordSink() {
3434
// `password` arg in `init` is a sink
3535
exists(ClassOrStructDecl c, ConstructorDecl f, CallExpr call |
36-
c.getFullName() = ["HKDF", "PBKDF1", "PBKDF2", "Scrypt"] and
36+
c.getName() = ["HKDF", "PBKDF1", "PBKDF2", "Scrypt"] and
3737
c.getAMember() = f and
3838
call.getStaticTarget() = f and
3939
call.getArgumentWithLabel("password").getExpr() = this
4040
)
4141
or
4242
// RNCryptor (labelled arguments)
4343
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
44-
c.getFullName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
44+
c.getName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
4545
c.getAMember() = f and
4646
call.getStaticTarget() = f and
4747
call.getArgumentWithLabel(["password", "withPassword", "forPassword"]).getExpr() = this

swift/ql/src/queries/Security/CWE-760/ConstantSalt.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ class ConstantSaltSink extends Expr {
3434
ConstantSaltSink() {
3535
// `salt` arg in `init` is a sink
3636
exists(ClassOrStructDecl c, ConstructorDecl f, CallExpr call |
37-
c.getFullName() = ["HKDF", "PBKDF1", "PBKDF2", "Scrypt"] and
37+
c.getName() = ["HKDF", "PBKDF1", "PBKDF2", "Scrypt"] and
3838
c.getAMember() = f and
3939
call.getStaticTarget() = f and
4040
call.getArgumentWithLabel("salt").getExpr() = this
4141
)
4242
or
4343
// RNCryptor
4444
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
45-
c.getFullName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
45+
c.getName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
4646
c.getAMember() = f and
4747
call.getStaticTarget() = f and
4848
call.getArgumentWithLabel(["salt", "encryptionSalt", "hmacSalt", "HMACSalt"]).getExpr() = this

swift/ql/src/queries/Security/CWE-916/InsufficientHashIterations.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class InsufficientHashIterationsSink extends Expr {
3434
InsufficientHashIterationsSink() {
3535
// `iterations` arg in `init` is a sink
3636
exists(ClassOrStructDecl c, ConstructorDecl f, CallExpr call |
37-
c.getFullName() = ["PBKDF1", "PBKDF2"] and
37+
c.getName() = ["PBKDF1", "PBKDF2"] and
3838
c.getAMember() = f and
3939
call.getStaticTarget() = f and
4040
call.getArgumentWithLabel("iterations").getExpr() = this

swift/ql/test/query-tests/Security/CWE-916/InsufficientHashIterations.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ subpaths
1414
| test.swift:37:84:37:84 | lowIterations | test.swift:20:45:20:45 | 99999 : | test.swift:37:84:37:84 | lowIterations | The value '99999' is an insufficient number of iterations for secure password hashing. |
1515
| test.swift:38:84:38:84 | 80000 | test.swift:38:84:38:84 | 80000 | test.swift:38:84:38:84 | 80000 | The value '80000' is an insufficient number of iterations for secure password hashing. |
1616
| test.swift:44:84:44:84 | lowIterations | test.swift:20:45:20:45 | 99999 : | test.swift:44:84:44:84 | lowIterations | The value '99999' is an insufficient number of iterations for secure password hashing. |
17-
| test.swift:45:84:45:84 | 80000 | test.swift:45:84:45:84 | 80000 | test.swift:45:84:45:84 | 80000 | The value '80000' is an insufficient number of iterations for secure password hashing. |
17+
| test.swift:45:84:45:84 | 80000 | test.swift:45:84:45:84 | 80000 | test.swift:45:84:45:84 | 80000 | The value '80000' is an insufficient number of iterations for secure password hashing. |

0 commit comments

Comments
 (0)