JS: add blockMode to CryptographicOperation tests

This commit is contained in:
Alex Ford
2023-02-02 16:16:44 +00:00
parent 1435ef1862
commit c25dc978df
2 changed files with 44 additions and 32 deletions

View File

@@ -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)