Merge pull request #435 from owen-mc/use-implements-where-possible

Use `implements` for interface methods
This commit is contained in:
Owen Mansel-Chan
2020-12-17 16:02:14 +00:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -74,7 +74,7 @@ module Revel {
}
private class ServerCookieGetValue extends TaintTracking::FunctionModel, Method {
ServerCookieGetValue() { this.hasQualifiedName(packagePath(), "ServerCookie", "GetValue") }
ServerCookieGetValue() { this.implements(packagePath(), "ServerCookie", "GetValue") }
override predicate hasTaintFlow(FunctionInput inp, FunctionOutput outp) {
inp.isReceiver() and outp.isResult()
@@ -83,7 +83,7 @@ module Revel {
private class ServerMultipartFormGetFiles extends TaintTracking::FunctionModel, Method {
ServerMultipartFormGetFiles() {
this.hasQualifiedName(packagePath(), "ServerMultipartForm", ["GetFiles", "GetValues"])
this.implements(packagePath(), "ServerMultipartForm", ["GetFiles", "GetValues"])
}
override predicate hasTaintFlow(FunctionInput inp, FunctionOutput outp) {

View File

@@ -34,9 +34,9 @@ private class DefaultSafeExternalAPIFunction extends SafeExternalAPIFunction {
this.(Method).hasQualifiedName(package("golang.org/x/oauth2", ""), "Config", "Exchange") or
this.hasQualifiedName(package("golang.org/x/crypto", "bcrypt"), "CompareHashAndPassword") or
this.hasQualifiedName(package("golang.org/x/crypto", "bcrypt"), "GenerateFromPassword") or
this.(Method).hasQualifiedName("hash", "Hash", "Sum") or
this.(Method).hasQualifiedName("hash", "Hash32", "Sum32") or
this.(Method).hasQualifiedName("hash", "Hash64", "Sum64") or
this.(Method).implements("hash", "Hash", "Sum") or
this.(Method).implements("hash", "Hash32", "Sum32") or
this.(Method).implements("hash", "Hash64", "Sum64") or
this.hasQualifiedName("crypto/sha256", "Sum256") or
this.hasQualifiedName("crypto/md5", "Sum") or
this.hasQualifiedName("crypto/sha1", "Sum")