This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
ql/src/semmle/go/frameworks/stdlib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,39 @@ import go
66
77/** Provides models of commonly used functions in the `encoding/pem` package. */
88module EncodingPem {
9+ /** The `Encode` function in the `encoding/pem` package. */
10+ private class EncodeFunction extends MarshalingFunction:: Range {
11+ EncodeFunction ( ) { hasQualifiedName ( "encoding/pem" , "Encode" ) }
12+
13+ override FunctionInput getAnInput ( ) { result .isParameter ( 1 ) }
14+
15+ override FunctionOutput getOutput ( ) { result .isParameter ( 0 ) }
16+
17+ override string getFormat ( ) { result = "PEM" }
18+ }
19+
20+ /** The `EncodeToMemory` function in the `encoding/pem` package. */
21+ private class EncodeToMemoryFunction extends MarshalingFunction:: Range {
22+ EncodeToMemoryFunction ( ) { hasQualifiedName ( "encoding/pem" , "EncodeToMemory" ) }
23+
24+ override FunctionInput getAnInput ( ) { result .isParameter ( 0 ) }
25+
26+ override FunctionOutput getOutput ( ) { result .isResult ( ) }
27+
28+ override string getFormat ( ) { result = "PEM" }
29+ }
30+
31+ /** The `Decode` function in the `encoding/pem` package. */
32+ private class UnmarshalFunction extends UnmarshalingFunction:: Range {
33+ UnmarshalFunction ( ) { hasQualifiedName ( "encoding/pem" , "Decode" ) }
34+
35+ override FunctionInput getAnInput ( ) { result .isParameter ( 0 ) }
36+
37+ override FunctionOutput getOutput ( ) { result .isResult ( 0 ) }
38+
39+ override string getFormat ( ) { result = "PEM" }
40+ }
41+
942 private class FunctionModels extends TaintTracking:: FunctionModel {
1043 FunctionInput inp ;
1144 FunctionOutput outp ;
You can’t perform that action at this time.
0 commit comments