mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Crypto: Updating weak asymmetric key gen to include key exchange.
This commit is contained in:
@@ -17,6 +17,7 @@ where
|
||||
key.getCreatingOperation().getAKeySizeSource().asElement().(Literal).getValue().toInt() = keySize and
|
||||
alg = key.getAKnownAlgorithm() and // NOTE: if algorithm is not known (doesn't bind) we need a separate query
|
||||
not alg instanceof Crypto::EllipticCurveNode and // Elliptic curve sizes are handled separately and are more tied directly to the algorithm
|
||||
alg instanceof Crypto::AsymmetricAlgorithmNode and
|
||||
keySize < 2048
|
||||
select key, "Use of weak asymmetric key size (" + keySize.toString() + " bits) for algorithm $@",
|
||||
alg, alg.getAlgorithmName()
|
||||
|
||||
@@ -1467,7 +1467,8 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
|
||||
class AsymmetricAlgorithmNode extends TKeyCreationCandidateAlgorithm instanceof AlgorithmNode {
|
||||
AsymmetricAlgorithmNode() {
|
||||
this instanceof EllipticCurveNode or
|
||||
this.(KeyOperationAlgorithmNode).isAsymmetric()
|
||||
this.(KeyOperationAlgorithmNode).isAsymmetric() or
|
||||
this instanceof KeyAgreementAlgorithmNode
|
||||
}
|
||||
|
||||
string toString() { result = super.toString() }
|
||||
|
||||
Reference in New Issue
Block a user