Skip to content

Commit 43af306

Browse files
committed
dynamic: more detailed qldoc for CryptographicOperation#getBlockMode()
1 parent e8cbf72 commit 43af306

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ module Cryptography {
4545

4646
/**
4747
* Gets the block mode used to perform this cryptographic operation.
48-
* This may have no result - for example if the `CryptographicAlgorithm` used
49-
* is a stream cipher rather than a block cipher.
48+
*
49+
* This predicate is only expected to have a result if two conditions hold:
50+
* 1. The operation is an encryption operation, i.e. the algorithm used is an `EncryptionAlgorithm`, and
51+
* 2. The algorithm used is a block cipher (not a stream cipher).
52+
*
53+
* If either of these conditions do not hold, then this predicate should have no result.
5054
*/
5155
BlockMode getBlockMode() { result = super.getBlockMode() }
5256
}
@@ -69,8 +73,12 @@ module Cryptography {
6973

7074
/**
7175
* Gets the block mode used to perform this cryptographic operation.
72-
* This may have no result - for example if the `CryptographicAlgorithm` used
73-
* is a stream cipher rather than a block cipher.
76+
*
77+
* This predicate is only expected to have a result if two conditions hold:
78+
* 1. The operation is an encryption operation, i.e. the algorithm used is an `EncryptionAlgorithm`, and
79+
* 2. The algorithm used is a block cipher (not a stream cipher).
80+
*
81+
* If either of these conditions do not hold, then this predicate should have no result.
7482
*/
7583
abstract BlockMode getBlockMode();
7684
}

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ module Cryptography {
4545

4646
/**
4747
* Gets the block mode used to perform this cryptographic operation.
48-
* This may have no result - for example if the `CryptographicAlgorithm` used
49-
* is a stream cipher rather than a block cipher.
48+
*
49+
* This predicate is only expected to have a result if two conditions hold:
50+
* 1. The operation is an encryption operation, i.e. the algorithm used is an `EncryptionAlgorithm`, and
51+
* 2. The algorithm used is a block cipher (not a stream cipher).
52+
*
53+
* If either of these conditions do not hold, then this predicate should have no result.
5054
*/
5155
BlockMode getBlockMode() { result = super.getBlockMode() }
5256
}
@@ -69,8 +73,12 @@ module Cryptography {
6973

7074
/**
7175
* Gets the block mode used to perform this cryptographic operation.
72-
* This may have no result - for example if the `CryptographicAlgorithm` used
73-
* is a stream cipher rather than a block cipher.
76+
*
77+
* This predicate is only expected to have a result if two conditions hold:
78+
* 1. The operation is an encryption operation, i.e. the algorithm used is an `EncryptionAlgorithm`, and
79+
* 2. The algorithm used is a block cipher (not a stream cipher).
80+
*
81+
* If either of these conditions do not hold, then this predicate should have no result.
7482
*/
7583
abstract BlockMode getBlockMode();
7684
}

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ module Cryptography {
4545

4646
/**
4747
* Gets the block mode used to perform this cryptographic operation.
48-
* This may have no result - for example if the `CryptographicAlgorithm` used
49-
* is a stream cipher rather than a block cipher.
48+
*
49+
* This predicate is only expected to have a result if two conditions hold:
50+
* 1. The operation is an encryption operation, i.e. the algorithm used is an `EncryptionAlgorithm`, and
51+
* 2. The algorithm used is a block cipher (not a stream cipher).
52+
*
53+
* If either of these conditions do not hold, then this predicate should have no result.
5054
*/
5155
BlockMode getBlockMode() { result = super.getBlockMode() }
5256
}
@@ -69,8 +73,12 @@ module Cryptography {
6973

7074
/**
7175
* Gets the block mode used to perform this cryptographic operation.
72-
* This may have no result - for example if the `CryptographicAlgorithm` used
73-
* is a stream cipher rather than a block cipher.
76+
*
77+
* This predicate is only expected to have a result if two conditions hold:
78+
* 1. The operation is an encryption operation, i.e. the algorithm used is an `EncryptionAlgorithm`, and
79+
* 2. The algorithm used is a block cipher (not a stream cipher).
80+
*
81+
* If either of these conditions do not hold, then this predicate should have no result.
7482
*/
7583
abstract BlockMode getBlockMode();
7684
}

0 commit comments

Comments
 (0)