Skip to content

Commit 7a9315f

Browse files
committed
use set literal
1 parent 0240631 commit 7a9315f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

javascript/ql/lib/semmle/javascript/frameworks/CryptoLibraries.qll

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,9 @@ private module NodeJSCrypto {
141141
* Also matches `createHash`, `createHmac`, `createSign` instead of `createCipher`.
142142
*/
143143

144-
exists(DataFlow::SourceNode mod, string createSuffix |
145-
createSuffix = "Hash" or
146-
createSuffix = "Hmac" or
147-
createSuffix = "Sign" or
148-
createSuffix = "Cipher"
149-
|
144+
exists(DataFlow::SourceNode mod |
150145
mod = DataFlow::moduleImport("crypto") and
151-
this = mod.getAMemberCall("create" + createSuffix) and
146+
this = mod.getAMemberCall("create" + ["Hash", "Hmac", "Sign", "Cipher"]) and
152147
algorithm.matchesName(getArgument(0).getStringValue())
153148
)
154149
}

0 commit comments

Comments
 (0)