@@ -164,7 +164,7 @@ private module NodeJSCrypto {
164
164
exists ( DataFlow:: SourceNode mod |
165
165
mod = DataFlow:: moduleImport ( "crypto" ) and
166
166
this = mod .getAMemberCall ( "create" + [ "Hash" , "Hmac" , "Sign" , "Cipher" ] ) and
167
- algorithm .matchesName ( getArgument ( 0 ) .getStringValue ( ) )
167
+ algorithm .matchesName ( this . getArgument ( 0 ) .getStringValue ( ) )
168
168
)
169
169
}
170
170
@@ -190,15 +190,15 @@ private module NodeJSCrypto {
190
190
}
191
191
192
192
override CryptographicAlgorithm getAlgorithm ( ) {
193
- result .matchesName ( getArgument ( 0 ) .getStringValue ( ) )
193
+ result .matchesName ( this . getArgument ( 0 ) .getStringValue ( ) )
194
194
}
195
195
196
196
override int getSize ( ) {
197
197
symmetric = true and
198
- result = getOptionArgument ( 1 , "length" ) .getIntValue ( )
198
+ result = this . getOptionArgument ( 1 , "length" ) .getIntValue ( )
199
199
or
200
200
symmetric = false and
201
- result = getOptionArgument ( 1 , "modulusLength" ) .getIntValue ( )
201
+ result = this . getOptionArgument ( 1 , "modulusLength" ) .getIntValue ( )
202
202
}
203
203
204
204
override predicate isSymmetricKey ( ) { symmetric = true }
@@ -212,7 +212,7 @@ private module NodeJSCrypto {
212
212
213
213
override CryptographicAlgorithm getAlgorithm ( ) { none ( ) }
214
214
215
- override int getSize ( ) { result = getArgument ( 0 ) .getIntValue ( ) }
215
+ override int getSize ( ) { result = this . getArgument ( 0 ) .getIntValue ( ) }
216
216
217
217
override predicate isSymmetricKey ( ) { none ( ) }
218
218
}
@@ -224,7 +224,7 @@ private module NodeJSCrypto {
224
224
this = instantiation .getAMethodCall ( any ( string m | m = "update" or m = "write" ) ) .asExpr ( )
225
225
}
226
226
227
- override Expr getInput ( ) { result = getArgument ( 0 ) }
227
+ override Expr getInput ( ) { result = this . getArgument ( 0 ) }
228
228
229
229
override CryptographicAlgorithm getAlgorithm ( ) { result = instantiation .getAlgorithm ( ) }
230
230
}
@@ -365,9 +365,9 @@ private module CryptoJS {
365
365
override CryptographicAlgorithm getAlgorithm ( ) { result .matchesName ( algorithm ) }
366
366
367
367
override int getSize ( ) {
368
- result = getOptionArgument ( optionArg , "keySize" ) .getIntValue ( ) * 32 // size is in words
368
+ result = this . getOptionArgument ( optionArg , "keySize" ) .getIntValue ( ) * 32 // size is in words
369
369
or
370
- result = getArgument ( optionArg ) .getIntValue ( ) * 32 // size is in words
370
+ result = this . getArgument ( optionArg ) .getIntValue ( ) * 32 // size is in words
371
371
}
372
372
373
373
override predicate isSymmetricKey ( ) { any ( ) }
@@ -496,19 +496,19 @@ private module Forge {
496
496
// `require('forge').cipher.createCipher("3DES-CBC").update("secret", "key");`
497
497
( createName = "createCipher" or createName = "createDecipher" ) and
498
498
this = mod .getAPropertyRead ( "cipher" ) .getAMemberCall ( createName ) and
499
- getArgument ( 0 ) .asExpr ( ) .mayHaveStringValue ( cipherName ) and
499
+ this . getArgument ( 0 ) .asExpr ( ) .mayHaveStringValue ( cipherName ) and
500
500
cipherName = cipherPrefix + "-" + cipherSuffix and
501
501
cipherSuffix = [ "CBC" , "CFB" , "CTR" , "ECB" , "GCM" , "OFB" ] and
502
502
algorithmName = cipherPrefix and
503
- key = getArgument ( 1 )
503
+ key = this . getArgument ( 1 )
504
504
)
505
505
or
506
506
// `require("forge").rc2.createEncryptionCipher("key").update("secret");`
507
507
exists ( string createName |
508
508
createName = "createEncryptionCipher" or createName = "createDecryptionCipher"
509
509
|
510
510
this = mod .getAPropertyRead ( algorithmName ) .getAMemberCall ( createName ) and
511
- key = getArgument ( 0 )
511
+ key = this . getArgument ( 0 )
512
512
)
513
513
)
514
514
}
@@ -583,7 +583,7 @@ private module Forge {
583
583
result = this .getArgument ( 1 ) .getIntValue ( )
584
584
or
585
585
exists ( DataFlow:: CallNode call | call .getCalleeName ( ) = [ "getBytes" , "getBytesSync" ] |
586
- getArgument ( 1 ) .getALocalSource ( ) = call and
586
+ this . getArgument ( 1 ) .getALocalSource ( ) = call and
587
587
result = call .getArgument ( 0 ) .getIntValue ( ) * 8 // bytes to bits
588
588
)
589
589
}
0 commit comments