@@ -389,7 +389,7 @@ class JavaSecuritySignature extends JavaSecurityAlgoSpec {
389
389
override Expr getAlgoSpec ( ) { result = this .( ConstructorCall ) .getArgument ( 0 ) }
390
390
}
391
391
392
- /** A method call to the Java class `java.security.KeyPairGenerator`. */
392
+ /** An instance of a `java.security.KeyPairGenerator`. */
393
393
class JavaSecurityKeyPairGenerator extends JavaSecurityAlgoSpec {
394
394
JavaSecurityKeyPairGenerator ( ) {
395
395
exists ( Constructor c | c .getAReference ( ) = this |
@@ -405,6 +405,41 @@ class JavaSecurityKeyPairGenerator extends JavaSecurityAlgoSpec {
405
405
override Expr getAlgoSpec ( ) { result = this .( Call ) .getArgument ( 0 ) }
406
406
}
407
407
408
+ /** The Java class `java.security.AlgorithmParameterGenerator`. */
409
+ class AlgorithmParameterGenerator extends RefType {
410
+ AlgorithmParameterGenerator ( ) {
411
+ this .hasQualifiedName ( "java.security" , "AlgorithmParameterGenerator" )
412
+ }
413
+ }
414
+
415
+ /** The `init` method declared in `java.security.AlgorithmParameterGenerator`. */
416
+ class AlgoParamGeneratorInitMethod extends Method {
417
+ AlgoParamGeneratorInitMethod ( ) {
418
+ this .getDeclaringType ( ) instanceof AlgorithmParameterGenerator and
419
+ this .hasName ( "init" )
420
+ }
421
+ }
422
+
423
+ /** An instance of a `java.security.AlgorithmParameterGenerator`. */
424
+ class JavaSecurityAlgoParamGenerator extends JavaSecurityAlgoSpec {
425
+ JavaSecurityAlgoParamGenerator ( ) {
426
+ exists ( Constructor c | c .getAReference ( ) = this |
427
+ c .getDeclaringType ( ) instanceof AlgorithmParameterGenerator
428
+ )
429
+ or
430
+ exists ( Method m | m .getAReference ( ) = this |
431
+ m .getDeclaringType ( ) instanceof AlgorithmParameterGenerator and
432
+ m .getName ( ) = "getInstance"
433
+ )
434
+ }
435
+
436
+ override Expr getAlgoSpec ( ) {
437
+ exists ( Call c | c = this |
438
+ if c .getNumArgument ( ) = 3 then result = c .getArgument ( 2 ) else result = c .getArgument ( 0 )
439
+ )
440
+ }
441
+ }
442
+
408
443
/** The Java interface `java.security.spec.AlgorithmParameterSpec` */
409
444
abstract class AlgorithmParameterSpec extends RefType { }
410
445
0 commit comments