Skip to content

Commit 8d90c02

Browse files
committed
JS: remove unused field
1 parent ecafce8 commit 8d90c02

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ private module BrowserIdCrypto {
149149
*/
150150
private module NodeJSCrypto {
151151
private class InstantiatedAlgorithm extends DataFlow::CallNode {
152-
CryptographicAlgorithm algorithm; // non-functional
153152
private string algorithmName;
154153

155154
InstantiatedAlgorithm() {
@@ -169,12 +168,11 @@ private module NodeJSCrypto {
169168
exists(DataFlow::SourceNode mod |
170169
mod = DataFlow::moduleImport("crypto") and
171170
this = mod.getAMemberCall("create" + ["Hash", "Hmac", "Sign", "Cipher"]) and
172-
algorithmName = this.getArgument(0).getStringValue() and
173-
algorithm.matchesName(algorithmName)
171+
algorithmName = this.getArgument(0).getStringValue()
174172
)
175173
}
176174

177-
CryptographicAlgorithm getAlgorithm() { result = algorithm }
175+
CryptographicAlgorithm getAlgorithm() { result.matchesName(algorithmName) }
178176

179177
private BlockMode getExplicitBlockMode() { result.matchesString(algorithmName) }
180178

0 commit comments

Comments
 (0)