mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Code review
This commit is contained in:
@@ -11,19 +11,19 @@
|
||||
import go
|
||||
import DataFlow::PathGraph
|
||||
|
||||
/**
|
||||
* RSA key length data flow tracking configuration.
|
||||
*/
|
||||
class RsaKeyTrackingConfiguration extends DataFlow::Configuration {
|
||||
RsaKeyTrackingConfiguration() { this = "RsaKeyTrackingConfiguration" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
exists(ValueExpr c |
|
||||
source.asExpr() = c and
|
||||
c.getIntValue() < 2048
|
||||
)
|
||||
source.asExpr().(ValueExpr).getIntValue() < 2048
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists(CallExpr c |
|
||||
sink.asExpr() = c.getArgument(1) and
|
||||
exists(DataFlow::CallNode c |
|
||||
sink = c.getArgument(1) and
|
||||
c.getTarget().hasQualifiedName("crypto/rsa", "GenerateKey")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ func main() {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(pvk)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ func main() {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(pvk)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,3 @@ func foo4() {
|
||||
func foo5(size int) {
|
||||
rsa.GenerateKey(rand.Reader, size)
|
||||
}
|
||||
|
||||
func main() {
|
||||
foo1()
|
||||
foo2()
|
||||
foo3()
|
||||
foo4()
|
||||
}
|
||||
Reference in New Issue
Block a user