@@ -27,7 +27,6 @@ abstract class SigningAlgorithmInstance extends Crypto::KeyOperationAlgorithmIns
2727
2828 override Crypto:: ConsumerInputDataFlowNode getKeySizeConsumer ( ) { none ( ) }
2929
30-
3130 override int getKeySizeFixed ( ) { none ( ) }
3231}
3332
@@ -160,28 +159,37 @@ class CipherModeLiteralInstance extends Crypto::ModeOfOperationAlgorithmInstance
160159}
161160
162161/**
163- * A call to either `Encrypt` or `Decrypt` on an `AesGcm` or `AesCcm` instance.
164- * The algorithm is defined implicitly by this AST node.
162+ * A call to either `Encrypt` or `Decrypt` on an `AesGcm`, `AesCcm`, or
163+ * `ChaCha20Poly1305` instance. The algorithm is defined implicitly by this AST
164+ * node.
165165 */
166- class AesModeAlgorithmInstance extends Crypto:: KeyOperationAlgorithmInstance ,
167- Crypto:: ModeOfOperationAlgorithmInstance instanceof AesModeUse
166+ class AeadAlgorithmInstance extends Crypto:: KeyOperationAlgorithmInstance ,
167+ Crypto:: ModeOfOperationAlgorithmInstance instanceof AeadUse
168168{
169- override string getRawAlgorithmName ( ) { result = "Aes" }
169+ override string getRawAlgorithmName ( ) {
170+ super .getQualifier ( ) .getType ( ) .hasName ( "Aes%" ) and result = "Aes"
171+ or
172+ super .getQualifier ( ) .getType ( ) .hasName ( "ChaCha20%" ) and result = "ChaCha20"
173+ }
170174
171175 override string getRawModeAlgorithmName ( ) {
172- this . getRawAlgorithmName ( ) = "AesGcm" and result = "Gcm"
176+ super . getQualifier ( ) . getType ( ) . getName ( ) = "AesGcm" and result = "Gcm"
173177 or
174- this . getRawAlgorithmName ( ) = "AesCcm" and result = "Ccm"
178+ super . getQualifier ( ) . getType ( ) . getName ( ) = "AesCcm" and result = "Ccm"
175179 }
176180
177181 override Crypto:: KeyOpAlg:: Algorithm getAlgorithmType ( ) {
182+ this .getRawAlgorithmName ( ) = "Aes" and
178183 result = Crypto:: KeyOpAlg:: TSymmetricCipher ( Crypto:: KeyOpAlg:: AES ( ) )
184+ or
185+ this .getRawAlgorithmName ( ) = "ChaCha20" and
186+ result = Crypto:: KeyOpAlg:: TSymmetricCipher ( Crypto:: KeyOpAlg:: CHACHA20 ( ) )
179187 }
180188
181189 override Crypto:: TBlockCipherModeOfOperationType getModeType ( ) {
182- this .getRawAlgorithmName ( ) = "AesGcm " and result = Crypto:: GCM ( )
190+ this .getRawModeAlgorithmName ( ) = "Gcm " and result = Crypto:: GCM ( )
183191 or
184- this .getRawAlgorithmName ( ) = "AesCcm " and result = Crypto:: CCM ( )
192+ this .getRawModeAlgorithmName ( ) = "Ccm " and result = Crypto:: CCM ( )
185193 }
186194
187195 override int getKeySizeFixed ( ) { none ( ) }
0 commit comments