Swift: Address false positives.

This commit is contained in:
Geoffrey White
2023-12-15 13:11:43 +00:00
parent 326242a1fb
commit 034daa9b35

View File

@@ -111,3 +111,18 @@ private class DefaultWeakPasswordHashingSink extends WeakPasswordHashingSink {
override string getAlgorithm() { result = algorithm }
}
/**
* A barrier for weak password hashing, when it occurs inside of
* certain cryptographic algorithms as part of their design.
*/
class WeakPasswordHashingImplementationBarrier extends WeakPasswordHashingBarrier {
WeakPasswordHashingImplementationBarrier() {
this.asParameter()
.getDeclaringFunction()
.(Function)
.getDeclaringDecl*()
.(NominalTypeDecl)
.getName() = ["HMAC", "PBKDF1", "PBKDF2"]
}
}