-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathICryptoTransform.qll
More file actions
33 lines (28 loc) · 963 Bytes
/
ICryptoTransform.qll
File metadata and controls
33 lines (28 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import csharp
import semmle.code.csharp.dataflow.DataFlow
import csharp
class ImplementsICryptoTransform extends Class {
ImplementsICryptoTransform() {
this.getABaseType*().hasQualifiedName("System.Security.Cryptography", "ICryptoTransform")
}
}
predicate usesICryptoTransformType(ValueOrRefType t) {
exists(ImplementsICryptoTransform ict |
ict = t or
usesICryptoTransformType(t.getAChild())
)
}
predicate hasICryptoTransformMember(Class c) {
c.getAField().getType() instanceof UsesICryptoTransform
}
class UsesICryptoTransform extends Class {
UsesICryptoTransform() { usesICryptoTransformType(this) or hasICryptoTransformMember(this) }
}
class LambdaCapturingICryptoTransformSource extends DataFlow::Node {
LambdaCapturingICryptoTransformSource() {
exists(LambdaExpr l, LocalScopeVariable lsvar, UsesICryptoTransform ict | l = this.asExpr() |
ict = lsvar.getType() and
lsvar.getACapturingCallable() = l
)
}
}