mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
JS: add blockMode to CryptographicOperation tests
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
import javascript
|
||||
|
||||
string getBlockMode(CryptographicOperation operation) {
|
||||
if
|
||||
operation.getAlgorithm() instanceof EncryptionAlgorithm and
|
||||
not operation.getAlgorithm().(EncryptionAlgorithm).isStreamCipher()
|
||||
then
|
||||
if exists(operation.getBlockMode())
|
||||
then result = operation.getBlockMode()
|
||||
else result = "<unknown>"
|
||||
else result = "<none>"
|
||||
}
|
||||
|
||||
from CryptographicOperation operation
|
||||
select operation, operation.getAlgorithm().getName(), operation.getAnInput()
|
||||
select operation, operation.getAlgorithm().getName(), operation.getAnInput(),
|
||||
getBlockMode(operation)
|
||||
|
||||
Reference in New Issue
Block a user