@@ -19,19 +19,40 @@ module HardcodedDataInterpretedAsCode {
1919 * Flow states used to distinguish value-preserving flow from taint flow.
2020 */
2121 module FlowState {
22- /** Flow state used to track value-preserving flow. */
23- DataFlow:: FlowState data ( ) { result = "data" }
22+ /**
23+ * Flow state used to track value-preserving flow.
24+ * DEPRECATED: Use `Data()`
25+ */
26+ deprecated DataFlow:: FlowState data ( ) { result = "data" }
2427
25- /** Flow state used to tainted data (non-value preserving flow). */
26- DataFlow:: FlowState taint ( ) { result = "taint" }
28+ /**
29+ * Flow state used to tainted data (non-value preserving flow).
30+ * DEPRECATED: Use `Taint()`
31+ */
32+ deprecated DataFlow:: FlowState taint ( ) { result = "taint" }
33+
34+ /**
35+ * Flow states used to distinguish value-preserving flow from taint flow.
36+ */
37+ newtype State =
38+ Data ( ) or
39+ Taint ( )
2740 }
2841
2942 /**
3043 * A data flow source for hard-coded data.
3144 */
3245 abstract class Source extends DataFlow:: Node {
33- /** Gets a flow label for which this is a source. */
34- DataFlow:: FlowState getLabel ( ) { result = FlowState:: data ( ) }
46+ /**
47+ * Gets a flow label for which this is a source.
48+ * DEPRECATED: Use `getALabel()`
49+ */
50+ deprecated DataFlow:: FlowState getLabel ( ) { result = FlowState:: data ( ) }
51+
52+ /**
53+ * Gets a flow label for which this is a source.
54+ */
55+ FlowState:: State getALabel ( ) { result = FlowState:: Data ( ) }
3556 }
3657
3758 /**
@@ -41,13 +62,26 @@ module HardcodedDataInterpretedAsCode {
4162 /** Gets a description of what kind of sink this is. */
4263 abstract string getKind ( ) ;
4364
44- /** Gets a flow label for which this is a sink. */
45- DataFlow:: FlowState getLabel ( ) {
65+ /**
66+ * Gets a flow label for which this is a sink.
67+ * DEPRECATED: Use `getALabel()`
68+ */
69+ deprecated DataFlow:: FlowState getLabel ( ) {
4670 // We want to ignore value-flow and only consider taint-flow, since the
4771 // source is just a hex string, and evaluating that directly will just
4872 // cause a syntax error.
4973 result = FlowState:: taint ( )
5074 }
75+
76+ /**
77+ * Gets a flow label for which this is a sink.
78+ */
79+ FlowState:: State getALabel ( ) {
80+ // We want to ignore value-flow and only consider taint-flow, since the
81+ // source is just a hex string, and evaluating that directly will just
82+ // cause a syntax error.
83+ result = FlowState:: Taint ( )
84+ }
5185 }
5286
5387 /** A sanitizer for hard-coded data. */
0 commit comments