@@ -295,7 +295,7 @@ module JCAModel {
295295
296296 class CipherGetInstanceCall extends MethodCall {
297297 CipherGetInstanceCall ( ) {
298- this .getCallee ( ) .hasQualifiedName ( "javax .crypto", "Cipher" , "getInstance" )
298+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "Cipher" , "getInstance" )
299299 }
300300
301301 Expr getAlgorithmArg ( ) { result = this .getArgument ( 0 ) }
@@ -307,7 +307,8 @@ module JCAModel {
307307 private class CipherOperationCall extends MethodCall {
308308 CipherOperationCall ( ) {
309309 this .getMethod ( )
310- .hasQualifiedName ( "javax.crypto" , "Cipher" , [ "update" , "doFinal" , "wrap" , "unwrap" ] )
310+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "Cipher" ,
311+ [ "update" , "doFinal" , "wrap" , "unwrap" ] )
311312 }
312313
313314 predicate isIntermediate ( ) { this .getMethod ( ) .getName ( ) = "update" }
@@ -474,7 +475,9 @@ module JCAModel {
474475 * An access to the `javax.crypto.Cipher` class.
475476 */
476477 private class CipherAccess extends TypeAccess {
477- CipherAccess ( ) { this .getType ( ) .( Class ) .hasQualifiedName ( "javax.crypto" , "Cipher" ) }
478+ CipherAccess ( ) {
479+ this .getType ( ) .( Class ) .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "Cipher" )
480+ }
478481 }
479482
480483 /**
@@ -708,7 +711,9 @@ module JCAModel {
708711 // and through setter methods
709712 class IvParameterSpecInstance extends NonceParameterInstantiation {
710713 IvParameterSpecInstance ( ) {
711- super .getConstructedType ( ) .hasQualifiedName ( "javax.crypto.spec" , "IvParameterSpec" )
714+ super
715+ .getConstructedType ( )
716+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto.spec" , "IvParameterSpec" )
712717 }
713718
714719 override DataFlow:: Node getInputNode ( ) { result .asExpr ( ) = super .getArgument ( 0 ) }
@@ -717,15 +722,18 @@ module JCAModel {
717722 // TODO: this also specifies the tag length for GCM
718723 class GCMParameterSpecInstance extends NonceParameterInstantiation {
719724 GCMParameterSpecInstance ( ) {
720- super .getConstructedType ( ) .hasQualifiedName ( "javax.crypto.spec" , "GCMParameterSpec" )
725+ super
726+ .getConstructedType ( )
727+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto.spec" , "GCMParameterSpec" )
721728 }
722729
723730 override DataFlow:: Node getInputNode ( ) { result .asExpr ( ) = super .getArgument ( 1 ) }
724731 }
725732
726733 class IvParameterSpecGetIvCall extends MethodCall {
727734 IvParameterSpecGetIvCall ( ) {
728- this .getMethod ( ) .hasQualifiedName ( "javax.crypto.spec" , "IvParameterSpec" , "getIV" )
735+ this .getMethod ( )
736+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto.spec" , "IvParameterSpec" , "getIV" )
729737 }
730738 }
731739
@@ -797,7 +805,9 @@ module JCAModel {
797805 }
798806
799807 class CipherInitCall extends MethodCall {
800- CipherInitCall ( ) { this .getCallee ( ) .hasQualifiedName ( "javax.crypto" , "Cipher" , "init" ) }
808+ CipherInitCall ( ) {
809+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "Cipher" , "init" )
810+ }
801811
802812 /**
803813 * Returns the mode argument to the `init` method
@@ -966,7 +976,9 @@ module JCAModel {
966976
967977 class DHGenParameterSpecInstance extends KeyGeneratorParameterSpecClassInstanceExpr {
968978 DHGenParameterSpecInstance ( ) {
969- super .getConstructedType ( ) .hasQualifiedName ( "javax.crypto.spec" , "DHGenParameterSpec" )
979+ super
980+ .getConstructedType ( )
981+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto.spec" , "DHGenParameterSpec" )
970982 }
971983
972984 Expr getPrimeSizeArg ( ) { result = this .getArgument ( 0 ) }
@@ -1067,7 +1079,7 @@ module JCAModel {
10671079 //TODO: Link getAlgorithm from KeyPairGenerator to algorithm instances or AVCs? High priority.
10681080 class KeyGeneratorGetInstanceCall extends MethodCall {
10691081 KeyGeneratorGetInstanceCall ( ) {
1070- this .getCallee ( ) .hasQualifiedName ( "javax .crypto", "KeyGenerator" , "getInstance" )
1082+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "KeyGenerator" , "getInstance" )
10711083 or
10721084 this .getCallee ( ) .hasQualifiedName ( "java.security" , "KeyPairGenerator" , "getInstance" )
10731085 }
@@ -1082,7 +1094,8 @@ module JCAModel {
10821094 this .getCallee ( ) .hasQualifiedName ( "java.security" , "KeyPairGenerator" , "initialize" ) and
10831095 keyType = Crypto:: TAsymmetricKeyType ( )
10841096 or
1085- this .getCallee ( ) .hasQualifiedName ( "javax.crypto" , "KeyGenerator" , [ "init" , "initialize" ] ) and
1097+ this .getCallee ( )
1098+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "KeyGenerator" , [ "init" , "initialize" ] ) and
10861099 keyType = Crypto:: TSymmetricKeyType ( )
10871100 }
10881101
@@ -1111,7 +1124,7 @@ module JCAModel {
11111124 Crypto:: KeyArtifactType type ;
11121125
11131126 KeyGeneratorGenerateCall ( ) {
1114- this .getCallee ( ) .hasQualifiedName ( "javax .crypto", "KeyGenerator" , "generateKey" ) and
1127+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "KeyGenerator" , "generateKey" ) and
11151128 type instanceof Crypto:: TSymmetricKeyType
11161129 or
11171130 this .getCallee ( )
@@ -1176,7 +1189,7 @@ module JCAModel {
11761189 class KeySpecInstantiation extends ClassInstanceExpr {
11771190 KeySpecInstantiation ( ) {
11781191 this .getConstructedType ( )
1179- .hasQualifiedName ( "javax .crypto.spec",
1192+ .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto.spec",
11801193 [ "PBEKeySpec" , "SecretKeySpec" , "PBEKeySpec" , "DESedeKeySpec" ] )
11811194 }
11821195
@@ -1227,15 +1240,17 @@ module JCAModel {
12271240
12281241 class SecretKeyFactoryGetInstanceCall extends MethodCall {
12291242 SecretKeyFactoryGetInstanceCall ( ) {
1230- this .getCallee ( ) .hasQualifiedName ( "javax.crypto" , "SecretKeyFactory" , "getInstance" )
1243+ this .getCallee ( )
1244+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "SecretKeyFactory" , "getInstance" )
12311245 }
12321246
12331247 Expr getAlgorithmArg ( ) { result = this .getArgument ( 0 ) }
12341248 }
12351249
12361250 class SecretKeyFactoryGenerateSecretCall extends MethodCall {
12371251 SecretKeyFactoryGenerateSecretCall ( ) {
1238- this .getCallee ( ) .hasQualifiedName ( "javax.crypto" , "SecretKeyFactory" , "generateSecret" )
1252+ this .getCallee ( )
1253+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "SecretKeyFactory" , "generateSecret" )
12391254 }
12401255
12411256 Expr getKeySpecArg ( ) { result = this .getArgument ( 0 ) }
@@ -1430,15 +1445,15 @@ module JCAModel {
14301445
14311446 class KeyAgreementInitCall extends MethodCall {
14321447 KeyAgreementInitCall ( ) {
1433- this .getCallee ( ) .hasQualifiedName ( "javax .crypto", "KeyAgreement" , "init" )
1448+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "KeyAgreement" , "init" )
14341449 }
14351450
14361451 Expr getServerKeyArg ( ) { result = this .getArgument ( 0 ) }
14371452 }
14381453
14391454 class KeyAgreementGetInstanceCall extends MethodCall {
14401455 KeyAgreementGetInstanceCall ( ) {
1441- this .getCallee ( ) .hasQualifiedName ( "javax .crypto", "KeyAgreement" , "getInstance" )
1456+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "KeyAgreement" , "getInstance" )
14421457 }
14431458
14441459 Expr getAlgorithmArg ( ) { result = super .getArgument ( 0 ) }
@@ -1482,7 +1497,8 @@ module JCAModel {
14821497 class KeyAgreementCall extends MethodCall {
14831498 KeyAgreementCall ( ) {
14841499 this .getCallee ( )
1485- .hasQualifiedName ( "javax.crypto" , "KeyAgreement" , [ "generateSecret" , "doPhase" ] )
1500+ .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "KeyAgreement" ,
1501+ [ "generateSecret" , "doPhase" ] )
14861502 }
14871503
14881504 predicate isIntermediate ( ) { this .getCallee ( ) .getName ( ) = "doPhase" }
@@ -1647,7 +1663,9 @@ module JCAModel {
16471663 }
16481664
16491665 class MacGetInstanceCall extends MethodCall {
1650- MacGetInstanceCall ( ) { this .getCallee ( ) .hasQualifiedName ( "javax.crypto" , "Mac" , "getInstance" ) }
1666+ MacGetInstanceCall ( ) {
1667+ this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + ".crypto" , "Mac" , "getInstance" )
1668+ }
16511669
16521670 Expr getAlgorithmArg ( ) { result = this .getArgument ( 0 ) }
16531671
@@ -1663,7 +1681,7 @@ module JCAModel {
16631681 }
16641682
16651683 class MacInitCall extends MethodCall {
1666- MacInitCall ( ) { this .getCallee ( ) .hasQualifiedName ( "javax .crypto", "Mac" , "init" ) }
1684+ MacInitCall ( ) { this .getCallee ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "Mac" , "init" ) }
16671685
16681686 Expr getKeyArg ( ) {
16691687 result = this .getArgument ( 0 ) and this .getMethod ( ) .getParameterType ( 0 ) .hasName ( "Key" )
@@ -1691,7 +1709,7 @@ module JCAModel {
16911709 Expr output ;
16921710
16931711 MacOperationCall ( ) {
1694- super .getMethod ( ) .getDeclaringType ( ) .hasQualifiedName ( "javax .crypto", "Mac" ) and
1712+ super .getMethod ( ) .getDeclaringType ( ) .hasQualifiedName ( javaxOrJakarta ( ) + " .crypto", "Mac" ) and
16951713 (
16961714 super .getMethod ( ) .hasStringSignature ( [ "doFinal()" , "doFinal(byte[])" ] ) and this = output
16971715 or
0 commit comments