File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
shared/cryptography/codeql/cryptography Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2122,6 +2122,12 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
2122
2122
*/
2123
2123
KeyOpAlg:: Algorithm getAlgorithmType ( ) { result = instance .asAlg ( ) .getAlgorithmType ( ) }
2124
2124
2125
+ predicate isAsymmetric ( ) {
2126
+ this .getAlgorithmType ( ) instanceof KeyOpAlg:: TAsymmetricCipher
2127
+ or
2128
+ this .getAlgorithmType ( ) instanceof KeyOpAlg:: TSignature
2129
+ }
2130
+
2125
2131
/**
2126
2132
* Gets the mode of operation of this cipher, e.g., "GCM" or "CBC".
2127
2133
*/
@@ -2442,4 +2448,11 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
2442
2448
location = this .getLocation ( )
2443
2449
}
2444
2450
}
2451
+
2452
+ predicate isAsymmetricAlgorithm ( AlgorithmNode node ) {
2453
+ node instanceof EllipticCurveNode
2454
+ or
2455
+ node instanceof KeyOperationAlgorithmNode and node .( KeyOperationAlgorithmNode ) .isAsymmetric ( )
2456
+ // TODO: get unknown algorithms from known asymmetric operations
2457
+ }
2445
2458
}
You can’t perform that action at this time.
0 commit comments