@@ -10,14 +10,14 @@ module EncValToInitEncArgConfig implements DataFlow::ConfigSig {
1010 predicate isSource ( DataFlow:: Node source ) { source .asExpr ( ) .getValue ( ) .toInt ( ) in [ 0 , 1 ] }
1111
1212 predicate isSink ( DataFlow:: Node sink ) {
13- exists ( EVP_Cipher_Inititalizer initCall | sink .asExpr ( ) = initCall .getOperataionSubtypeArg ( ) )
13+ exists ( EVP_Cipher_Initializer initCall | sink .asExpr ( ) = initCall .getOperationSubtypeArg ( ) )
1414 }
1515}
1616
1717module EncValToInitEncArgFlow = DataFlow:: Global< EncValToInitEncArgConfig > ;
1818
1919int getEncConfigValue ( Expr e ) {
20- exists ( EVP_Cipher_Inititalizer initCall | e = initCall .getOperataionSubtypeArg ( ) ) and
20+ exists ( EVP_Cipher_Initializer initCall | e = initCall .getOperationSubtypeArg ( ) ) and
2121 exists ( DataFlow:: Node a , DataFlow:: Node b |
2222 EncValToInitEncArgFlow:: flow ( a , b ) and b .asExpr ( ) = e and result = a .asExpr ( ) .getValue ( ) .toInt ( )
2323 )
@@ -34,7 +34,7 @@ Crypto::KeyOperationSubtype intToCipherOperationSubtype(int i) {
3434}
3535
3636// TODO: need to add key consumer
37- abstract class EVP_Cipher_Inititalizer extends Call {
37+ abstract class EVP_Cipher_Initializer extends Call {
3838 Expr getContextArg ( ) { result = this .( Call ) .getArgument ( 0 ) }
3939
4040 Expr getAlgorithmArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
@@ -44,7 +44,7 @@ abstract class EVP_Cipher_Inititalizer extends Call {
4444 abstract Expr getIVArg ( ) ;
4545
4646 // abstract Crypto::CipherOperationSubtype getCipherOperationSubtype();
47- abstract Expr getOperataionSubtypeArg ( ) ;
47+ abstract Expr getOperationSubtypeArg ( ) ;
4848
4949 Crypto:: KeyOperationSubtype getCipherOperationSubtype ( ) {
5050 if this .( Call ) .getTarget ( ) .getName ( ) .toLowerCase ( ) .matches ( "%encrypt%" )
@@ -53,19 +53,19 @@ abstract class EVP_Cipher_Inititalizer extends Call {
5353 if this .( Call ) .getTarget ( ) .getName ( ) .toLowerCase ( ) .matches ( "%decrypt%" )
5454 then result instanceof Crypto:: TDecryptMode
5555 else
56- if exists ( getEncConfigValue ( this .getOperataionSubtypeArg ( ) ) )
57- then result = intToCipherOperationSubtype ( getEncConfigValue ( this .getOperataionSubtypeArg ( ) ) )
56+ if exists ( getEncConfigValue ( this .getOperationSubtypeArg ( ) ) )
57+ then result = intToCipherOperationSubtype ( getEncConfigValue ( this .getOperationSubtypeArg ( ) ) )
5858 else result instanceof Crypto:: TUnknownKeyOperationMode
5959 }
6060}
6161
62- abstract class EVP_EX_Initializer extends EVP_Cipher_Inititalizer {
62+ abstract class EVP_EX_Initializer extends EVP_Cipher_Initializer {
6363 override Expr getKeyArg ( ) { result = this .( Call ) .getArgument ( 3 ) }
6464
6565 override Expr getIVArg ( ) { result = this .( Call ) .getArgument ( 4 ) }
6666}
6767
68- abstract class EVP_EX2_Initializer extends EVP_Cipher_Inititalizer {
68+ abstract class EVP_EX2_Initializer extends EVP_Cipher_Initializer {
6969 override Expr getKeyArg ( ) { result = this .( Call ) .getArgument ( 2 ) }
7070
7171 override Expr getIVArg ( ) { result = this .( Call ) .getArgument ( 3 ) }
@@ -78,7 +78,7 @@ class EVP_Cipher_EX_Init_Call extends EVP_EX_Initializer {
7878 ]
7979 }
8080
81- override Expr getOperataionSubtypeArg ( ) {
81+ override Expr getOperationSubtypeArg ( ) {
8282 this .( Call ) .getTarget ( ) .getName ( ) .toLowerCase ( ) .matches ( "%cipherinit%" ) and
8383 result = this .( Call ) .getArgument ( 5 )
8484 }
@@ -92,7 +92,7 @@ class EVP_Cipher_EX2_or_Simple_Init_Call extends EVP_EX2_Initializer {
9292 ]
9393 }
9494
95- override Expr getOperataionSubtypeArg ( ) {
95+ override Expr getOperationSubtypeArg ( ) {
9696 this .( Call ) .getTarget ( ) .getName ( ) .toLowerCase ( ) .matches ( "%cipherinit%" ) and
9797 result = this .( Call ) .getArgument ( 4 )
9898 }
@@ -101,23 +101,23 @@ class EVP_Cipher_EX2_or_Simple_Init_Call extends EVP_EX2_Initializer {
101101class EVP_CipherInit_SKEY_Call extends EVP_EX2_Initializer {
102102 EVP_CipherInit_SKEY_Call ( ) { this .( Call ) .getTarget ( ) .getName ( ) in [ "EVP_CipherInit_SKEY" ] }
103103
104- override Expr getOperataionSubtypeArg ( ) { result = this .( Call ) .getArgument ( 5 ) }
104+ override Expr getOperationSubtypeArg ( ) { result = this .( Call ) .getArgument ( 5 ) }
105105}
106106
107107class EVPCipherInitializerAlgorithmArgument extends Expr {
108108 EVPCipherInitializerAlgorithmArgument ( ) {
109- exists ( EVP_Cipher_Inititalizer initCall | this = initCall .getAlgorithmArg ( ) )
109+ exists ( EVP_Cipher_Initializer initCall | this = initCall .getAlgorithmArg ( ) )
110110 }
111111}
112112
113113class EVPCipherInitializerKeyArgument extends Expr {
114114 EVPCipherInitializerKeyArgument ( ) {
115- exists ( EVP_Cipher_Inititalizer initCall | this = initCall .getKeyArg ( ) )
115+ exists ( EVP_Cipher_Initializer initCall | this = initCall .getKeyArg ( ) )
116116 }
117117}
118118
119119class EVPCipherInitializerIVArgument extends Expr {
120120 EVPCipherInitializerIVArgument ( ) {
121- exists ( EVP_Cipher_Inititalizer initCall | this = initCall .getIVArg ( ) )
121+ exists ( EVP_Cipher_Initializer initCall | this = initCall .getIVArg ( ) )
122122 }
123123}
0 commit comments