Skip to content

Commit 034daa9

Browse files
committed
Swift: Address false positives.
1 parent 326242a commit 034daa9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

swift/ql/lib/codeql/swift/security/WeakPasswordHashingExtensions.qll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,18 @@ private class DefaultWeakPasswordHashingSink extends WeakPasswordHashingSink {
111111

112112
override string getAlgorithm() { result = algorithm }
113113
}
114+
115+
/**
116+
* A barrier for weak password hashing, when it occurs inside of
117+
* certain cryptographic algorithms as part of their design.
118+
*/
119+
class WeakPasswordHashingImplementationBarrier extends WeakPasswordHashingBarrier {
120+
WeakPasswordHashingImplementationBarrier() {
121+
this.asParameter()
122+
.getDeclaringFunction()
123+
.(Function)
124+
.getDeclaringDecl*()
125+
.(NominalTypeDecl)
126+
.getName() = ["HMAC", "PBKDF1", "PBKDF2"]
127+
}
128+
}

0 commit comments

Comments
 (0)