@@ -57,7 +57,7 @@ module NormalHashFunction {
57
57
abstract class Barrier extends DataFlow:: Node { }
58
58
59
59
/**
60
- * A flow source modelled by the `SensitiveData` library.
60
+ * A flow source modeled by the `SensitiveData` library.
61
61
*/
62
62
class SensitiveDataAsSource extends Source instanceof SensitiveData {
63
63
SensitiveDataAsSource ( ) {
@@ -71,7 +71,7 @@ module NormalHashFunction {
71
71
}
72
72
73
73
/**
74
- * A flow sink modelled by the `Cryptography` module.
74
+ * A flow sink modeled by the `Cryptography` module.
75
75
*/
76
76
class WeakHashingOperationInputAsSink extends Sink {
77
77
Cryptography:: HashingAlgorithm algorithm ;
@@ -134,7 +134,7 @@ module ComputationallyExpensiveHashFunction {
134
134
abstract class Barrier extends DataFlow:: Node { }
135
135
136
136
/**
137
- * A flow source modelled by the `SensitiveData` library.
137
+ * A flow source modeled by the `SensitiveData` library.
138
138
*/
139
139
class PasswordAsSource extends Source instanceof SensitiveData {
140
140
PasswordAsSource ( ) {
@@ -147,7 +147,7 @@ module ComputationallyExpensiveHashFunction {
147
147
}
148
148
149
149
/**
150
- * A flow sink modelled by the `Cryptography` module.
150
+ * A flow sink modeled by the `Cryptography` module.
151
151
*/
152
152
class WeakPasswordHashingOperationInputSink extends Sink {
153
153
Cryptography:: CryptographicAlgorithm algorithm ;
@@ -174,19 +174,20 @@ module ComputationallyExpensiveHashFunction {
174
174
}
175
175
176
176
/**
177
- * An externally modelled operation that hashes data, for example a call to `md5::Md5::digest(data)`.
177
+ * An externally modeled operation that hashes data, for example a call to `md5::Md5::digest(data)`.
178
178
*/
179
- class ModelledHashOperation extends Cryptography:: CryptographicOperation:: Range {
179
+ class ModeledHashOperation extends Cryptography:: CryptographicOperation:: Range {
180
180
DataFlow:: Node input ;
181
- CallExpr call ;
182
181
string algorithmName ;
183
182
184
- ModelledHashOperation ( ) {
185
- sinkNode ( input , "hasher-input" ) and
186
- call = input .( Node:: FlowSummaryNode ) .getSinkElement ( ) .getCall ( ) and
187
- call = this .asExpr ( ) .getExpr ( ) and
188
- algorithmName =
189
- call .getFunction ( ) .( PathExpr ) .getPath ( ) .getQualifier ( ) .getPart ( ) .getNameRef ( ) .getText ( )
183
+ ModeledHashOperation ( ) {
184
+ exists ( CallExpr call |
185
+ sinkNode ( input , "hasher-input" ) and
186
+ call = input .( Node:: FlowSummaryNode ) .getSinkElement ( ) .getCall ( ) and
187
+ call = this .asExpr ( ) .getExpr ( ) and
188
+ algorithmName =
189
+ call .getFunction ( ) .( PathExpr ) .getPath ( ) .getQualifier ( ) .getPart ( ) .getNameRef ( ) .getText ( )
190
+ )
190
191
}
191
192
192
193
override DataFlow:: Node getInitialization ( ) { result = this }
0 commit comments