Skip to content

Commit d3662cf

Browse files
committed
Deprecate CryptographicOperation#isWeak and add a default implementation
1 parent 3d66905 commit d3662cf

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

javascript/ql/lib/semmle/javascript/internal/ConceptsShared.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module Cryptography {
4343
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
4444
DataFlow::Node getAnInput() { result = super.getAnInput() }
4545

46-
/** Holds if this encryption operation is known to be weak. */
47-
predicate isWeak() { super.isWeak() }
46+
/** DEPRECATED: Use `getAlgorithm().isWeak() or getBlockMode().isWeak()` instead */
47+
deprecated predicate isWeak() { super.isWeak() }
4848

4949
/**
5050
* Gets the block mode used to perform this cryptographic operation.
@@ -70,8 +70,8 @@ module Cryptography {
7070
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
7171
abstract DataFlow::Node getAnInput();
7272

73-
/** Holds if this encryption operation is known to be weak. */
74-
abstract predicate isWeak();
73+
/** DEPRECATED: Use `getAlgorithm().isWeak() or getBlockMode().isWeak()` instead */
74+
deprecated predicate isWeak() { this.getAlgorithm().isWeak() or this.getBlockMode().isWeak() }
7575

7676
/**
7777
* Gets the block mode used to perform this cryptographic operation.

python/ql/lib/semmle/python/internal/ConceptsShared.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module Cryptography {
4343
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
4444
DataFlow::Node getAnInput() { result = super.getAnInput() }
4545

46-
/** Holds if this encryption operation is known to be weak. */
47-
predicate isWeak() { super.isWeak() }
46+
/** DEPRECATED: Use `getAlgorithm().isWeak() or getBlockMode().isWeak()` instead */
47+
deprecated predicate isWeak() { super.isWeak() }
4848

4949
/**
5050
* Gets the block mode used to perform this cryptographic operation.
@@ -70,8 +70,8 @@ module Cryptography {
7070
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
7171
abstract DataFlow::Node getAnInput();
7272

73-
/** Holds if this encryption operation is known to be weak. */
74-
abstract predicate isWeak();
73+
/** DEPRECATED: Use `getAlgorithm().isWeak() or getBlockMode().isWeak()` instead */
74+
deprecated predicate isWeak() { this.getAlgorithm().isWeak() or this.getBlockMode().isWeak() }
7575

7676
/**
7777
* Gets the block mode used to perform this cryptographic operation.

ruby/ql/lib/codeql/ruby/internal/ConceptsShared.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module Cryptography {
4343
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
4444
DataFlow::Node getAnInput() { result = super.getAnInput() }
4545

46-
/** Holds if this encryption operation is known to be weak. */
47-
predicate isWeak() { super.isWeak() }
46+
/** DEPRECATED: Use `getAlgorithm().isWeak() or getBlockMode().isWeak()` instead */
47+
deprecated predicate isWeak() { super.isWeak() }
4848

4949
/**
5050
* Gets the block mode used to perform this cryptographic operation.
@@ -70,8 +70,8 @@ module Cryptography {
7070
/** Gets an input the algorithm is used on, for example the plain text input to be encrypted. */
7171
abstract DataFlow::Node getAnInput();
7272

73-
/** Holds if this encryption operation is known to be weak. */
74-
abstract predicate isWeak();
73+
/** DEPRECATED: Use `getAlgorithm().isWeak() or getBlockMode().isWeak()` instead */
74+
deprecated predicate isWeak() { this.getAlgorithm().isWeak() or this.getBlockMode().isWeak() }
7575

7676
/**
7777
* Gets the block mode used to perform this cryptographic operation.

0 commit comments

Comments
 (0)