This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
test/library-tests/semmle/go/frameworks/StdlibTaintFlow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import semmle.go.frameworks.stdlib.EncodingCsv
2525import semmle.go.frameworks.stdlib.EncodingGob
2626import semmle.go.frameworks.stdlib.EncodingHex
2727import semmle.go.frameworks.stdlib.EncodingJson
28+ import semmle.go.frameworks.stdlib.EncodingPem
2829import semmle.go.frameworks.stdlib.Path
2930import semmle.go.frameworks.stdlib.PathFilepath
3031import semmle.go.frameworks.stdlib.Reflect
Original file line number Diff line number Diff line change 1+ /**
2+ * Provides classes modeling security-relevant aspects of the `encoding/pem` package.
3+ */
4+
5+ import go
6+
7+ /** Provides models of commonly used functions in the `encoding/pem` package. */
8+ module EncodingPem {
9+ private class FunctionModels extends TaintTracking:: FunctionModel {
10+ FunctionInput inp ;
11+ FunctionOutput outp ;
12+
13+ FunctionModels ( ) {
14+ // signature: func Decode(data []byte) (p *Block, rest []byte)
15+ hasQualifiedName ( "encoding/pem" , "Decode" ) and
16+ ( inp .isParameter ( 0 ) and outp .isResult ( _) )
17+ or
18+ // signature: func Encode(out io.Writer, b *Block) error
19+ hasQualifiedName ( "encoding/pem" , "Encode" ) and
20+ ( inp .isParameter ( 1 ) and outp .isParameter ( 0 ) )
21+ or
22+ // signature: func EncodeToMemory(b *Block) []byte
23+ hasQualifiedName ( "encoding/pem" , "EncodeToMemory" ) and
24+ ( inp .isParameter ( 0 ) and outp .isResult ( ) )
25+ }
26+
27+ override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
28+ input = inp and output = outp
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments