Skip to content

Commit 19ed6bb

Browse files
committed
feat: support getDerivedKeySizeSrc for argon2 variants
1 parent f2942ca commit 19ed6bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/ql/lib/experimental/cryptography/modules/CryptographyModule.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ module KDF {
146146

147147
// TODO: get encryption algorithm for CBC-based KDF?
148148
override DataFlow::Node getDerivedKeySizeSrc() {
149-
if this.getAlgorithm().getKDFName() in ["KBKDFHMAC", "KBKDFCMAC"]
149+
if this.getAlgorithm().getKDFName() = "ARGON2"
150+
then result = Utils::getUltimateSrcFromApiNode(this.getKeywordParameter("length"))
151+
else if this.getAlgorithm().getKDFName() in ["KBKDFHMAC", "KBKDFCMAC"]
150152
then result = Utils::getUltimateSrcFromApiNode(this.getParameter(2, "length"))
151153
else result = Utils::getUltimateSrcFromApiNode(this.getParameter(1, "length"))
152154
}

0 commit comments

Comments
 (0)