Skip to content

Commit 2b66dfa

Browse files
committed
Ruby: replace a range field with instanceof
1 parent b79bb72 commit 2b66dfa

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ruby/ql/lib/codeql/ruby/Concepts.qll

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -781,19 +781,15 @@ module Cryptography {
781781
* Extend this class to refine existing API models. If you want to model new APIs,
782782
* extend `CryptographicOperation::Range` instead.
783783
*/
784-
class CryptographicOperation extends DataFlow::Node {
785-
CryptographicOperation::Range range;
786-
787-
CryptographicOperation() { this = range }
788-
784+
class CryptographicOperation extends DataFlow::Node instanceof CryptographicOperation::Range {
789785
/** Gets the algorithm used, if it matches a known `CryptographicAlgorithm`. */
790-
CryptographicAlgorithm getAlgorithm() { result = range.getAlgorithm() }
786+
CryptographicAlgorithm getAlgorithm() { result = super.getAlgorithm() }
791787

792788
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
793-
DataFlow::Node getAnInput() { result = range.getAnInput() }
789+
DataFlow::Node getAnInput() { result = super.getAnInput() }
794790

795791
/** Holds if this encryption operation is known to be weak. */
796-
predicate isWeak() { range.isWeak() }
792+
predicate isWeak() { super.isWeak() }
797793
}
798794

799795
/** Provides classes for modeling new applications of a cryptographic algorithms. */

0 commit comments

Comments
 (0)