File tree Expand file tree Collapse file tree
shared/cryptography/codeql/cryptography Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2122,6 +2122,12 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
21222122 */
21232123 KeyOpAlg:: Algorithm getAlgorithmType ( ) { result = instance .asAlg ( ) .getAlgorithmType ( ) }
21242124
2125+ predicate isAsymmetric ( ) {
2126+ this .getAlgorithmType ( ) instanceof KeyOpAlg:: TAsymmetricCipher
2127+ or
2128+ this .getAlgorithmType ( ) instanceof KeyOpAlg:: TSignature
2129+ }
2130+
21252131 /**
21262132 * Gets the mode of operation of this cipher, e.g., "GCM" or "CBC".
21272133 */
@@ -2442,4 +2448,11 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
24422448 location = this .getLocation ( )
24432449 }
24442450 }
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+ }
24452458}
You can’t perform that action at this time.
0 commit comments