@@ -6,16 +6,16 @@ class CryptographyType extends Type {
66 CryptographyType ( ) { this .hasFullyQualifiedName ( "System.Security.Cryptography" , _) }
77}
88
9- class ECParameters extends CryptographyType {
10- ECParameters ( ) { this .hasName ( "ECParameters" ) }
9+ class EcParameters extends CryptographyType {
10+ EcParameters ( ) { this .hasName ( "ECParameters" ) }
1111}
1212
13- class RSAParameters extends CryptographyType {
14- RSAParameters ( ) { this .hasName ( "RSAParameters" ) }
13+ class RsaParameters extends CryptographyType {
14+ RsaParameters ( ) { this .hasName ( "RSAParameters" ) }
1515}
1616
17- class ECCurve extends CryptographyType {
18- ECCurve ( ) { this .hasName ( "ECCurve" ) }
17+ class EcCurve extends CryptographyType {
18+ EcCurve ( ) { this .hasName ( "ECCurve" ) }
1919}
2020
2121class HashAlgorithmType extends CryptographyType {
@@ -71,12 +71,12 @@ class EcdsaCreateCall extends CryptographyCreateCall {
7171}
7272
7373// This class is used to model the `ECDsa.Create(ECParameters)` call
74- class ECDsaCreateCallWithParameters extends EcdsaCreateCall {
75- ECDsaCreateCallWithParameters ( ) { this .getArgument ( 0 ) .getType ( ) instanceof ECParameters }
74+ class EcdsaCreateCallWithParameters extends EcdsaCreateCall {
75+ EcdsaCreateCallWithParameters ( ) { this .getArgument ( 0 ) .getType ( ) instanceof EcParameters }
7676}
7777
78- class ECDsaCreateCallWithECCurve extends EcdsaCreateCall {
79- ECDsaCreateCallWithECCurve ( ) { this .getArgument ( 0 ) .getType ( ) instanceof ECCurve }
78+ class EcdsaCreateCallWithECCurve extends EcdsaCreateCall {
79+ EcdsaCreateCallWithECCurve ( ) { this .getArgument ( 0 ) .getType ( ) instanceof EcCurve }
8080}
8181
8282class RsaCreateCall extends CryptographyCreateCall {
@@ -127,7 +127,7 @@ class NamedCurvePropertyAccess extends PropertyAccess {
127127
128128 NamedCurvePropertyAccess ( ) {
129129 super .getType ( ) .getName ( ) = "ECCurve" and
130- eccurveNameMapping ( super .getProperty ( ) .toString ( ) .toUpperCase ( ) , curveName )
130+ ecCurveNameMapping ( super .getProperty ( ) .toString ( ) .toUpperCase ( ) , curveName )
131131 }
132132
133133 string getCurveName ( ) { result = curveName }
@@ -196,7 +196,7 @@ class HashAlgorithmNameUser extends MethodCall {
196196 * Private predicate mapping NIST names to SEC names and leaving all others the same.
197197 */
198198bindingset [ nist]
199- private predicate eccurveNameMapping ( string nist , string secp ) {
199+ private predicate ecCurveNameMapping ( string nist , string secp ) {
200200 if nist .matches ( "NIST%" )
201201 then
202202 nist = "NISTP256" and secp = "secp256r1"
@@ -208,28 +208,28 @@ private predicate eccurveNameMapping(string nist, string secp) {
208208}
209209
210210// OPERATION INSTANCES
211- private class ECDsaClass extends CryptographyType {
212- ECDsaClass ( ) { this .hasName ( "ECDsa" ) }
211+ private class EcdsaClass extends CryptographyType {
212+ EcdsaClass ( ) { this .hasName ( "ECDsa" ) }
213213}
214214
215- private class RSAClass extends CryptographyType {
216- RSAClass ( ) { this .hasName ( "RSA" ) }
215+ private class RsaClass extends CryptographyType {
216+ RsaClass ( ) { this .hasName ( "RSA" ) }
217217}
218218
219- private class RSAPKCS1SignatureFormatter extends CryptographyType {
220- RSAPKCS1SignatureFormatter ( ) { this .hasName ( "RSAPKCS1SignatureFormatter" ) }
219+ private class RsaPkcs1SignatureFormatter extends CryptographyType {
220+ RsaPkcs1SignatureFormatter ( ) { this .hasName ( "RSAPKCS1SignatureFormatter" ) }
221221}
222222
223- private class RSAPKCS1SignatureDeformatter extends CryptographyType {
224- RSAPKCS1SignatureDeformatter ( ) { this .hasName ( "RSAPKCS1SignatureDeformatter" ) }
223+ private class RsaPkcs1SignatureDeformatter extends CryptographyType {
224+ RsaPkcs1SignatureDeformatter ( ) { this .hasName ( "RSAPKCS1SignatureDeformatter" ) }
225225}
226226
227227private class SignerType extends Type {
228228 SignerType ( ) {
229- this instanceof ECDsaClass or
230- this instanceof RSAClass or
231- this instanceof RSAPKCS1SignatureFormatter or
232- this instanceof RSAPKCS1SignatureDeformatter
229+ this instanceof EcdsaClass or
230+ this instanceof RsaClass or
231+ this instanceof RsaPkcs1SignatureFormatter or
232+ this instanceof RsaPkcs1SignatureDeformatter
233233 }
234234}
235235
@@ -631,8 +631,8 @@ class MacAlgorithmType extends CryptographyType {
631631 MacAlgorithmType ( ) { this .getName ( ) .matches ( [ "HMAC%" , "KeyedHashAlgorithm" ] ) }
632632}
633633
634- class HMACCreation extends ObjectCreation {
635- HMACCreation ( ) { this .getObjectType ( ) instanceof MacAlgorithmType }
634+ class HmacCreation extends ObjectCreation {
635+ HmacCreation ( ) { this .getObjectType ( ) instanceof MacAlgorithmType }
636636
637637 Expr getKeyArg ( ) { if this .hasNoArguments ( ) then result = this else result = this .getArgument ( 0 ) }
638638
@@ -674,7 +674,7 @@ class MacUse extends Crypto::AlgorithmValueConsumer instanceof MethodCall {
674674 Expr getKeyArg ( ) {
675675 if not super .getTarget ( ) .getName ( ) .matches ( "ComputeHash%" )
676676 then result = super .getArgument ( 0 )
677- else result = HMACFlow :: getCreationFromUse ( this , _, _) .getKeyArg ( )
677+ else result = HmacFlow :: getCreationFromUse ( this , _, _) .getKeyArg ( )
678678 }
679679
680680 override Crypto:: AlgorithmInstance getAKnownAlgorithmSource ( ) { result = super .getQualifier ( ) }
@@ -684,16 +684,16 @@ class MacUse extends Crypto::AlgorithmValueConsumer instanceof MethodCall {
684684 Expr getQualifier ( ) { result = super .getQualifier ( ) }
685685}
686686
687- class HMACAlgorithmInstance extends Crypto:: MACAlgorithmInstance instanceof Expr {
688- HMACAlgorithmInstance ( ) { this = any ( MacUse c ) .getQualifier ( ) }
687+ class HmacAlgorithmInstance extends Crypto:: MACAlgorithmInstance instanceof Expr {
688+ HmacAlgorithmInstance ( ) { this = any ( MacUse c ) .getQualifier ( ) }
689689
690690 override Crypto:: TMACType getMACType ( ) { result instanceof Crypto:: THMAC }
691691
692692 override string getRawMACAlgorithmName ( ) { result = super .getType ( ) .getName ( ) }
693693}
694694
695- class HMACAlgorithmQualifier extends Crypto:: HMACAlgorithmInstance , Crypto:: AlgorithmValueConsumer ,
696- HMACAlgorithmInstance , Crypto:: HashAlgorithmInstance instanceof Expr
695+ class HmacAlgorithmQualifier extends Crypto:: HMACAlgorithmInstance , Crypto:: AlgorithmValueConsumer ,
696+ HmacAlgorithmInstance , Crypto:: HashAlgorithmInstance instanceof Expr
697697{
698698 override Crypto:: AlgorithmValueConsumer getHashAlgorithmValueConsumer ( ) { result = this }
699699
@@ -718,7 +718,7 @@ class HMACAlgorithmQualifier extends Crypto::HMACAlgorithmInstance, Crypto::Algo
718718 private string getOriginalRawHashAlgorithmName ( ) {
719719 exists ( MacUse use |
720720 use .getQualifier ( ) = this and
721- result = HMACFlow :: getCreationFromUse ( use , _, _) .getRawAlgorithmName ( ) .replaceAll ( "HMAC" , "" )
721+ result = HmacFlow :: getCreationFromUse ( use , _, _) .getRawAlgorithmName ( ) .replaceAll ( "HMAC" , "" )
722722 )
723723 }
724724}
0 commit comments