forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeakRSA.ql
More file actions
25 lines (22 loc) · 728 Bytes
/
WeakRSA.ql
File metadata and controls
25 lines (22 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* @name Cipher is Weak RSA Implementation
* @id java/quantum/weak-rsa
* @description RSA with a key length <2048 found
* @kind problem
* @problem.severity error
* @security.severity low
* @precision high
* @tags quantum
* experimental
*/
import experimental.quantum.Language
class WeakRSAAlgorithmNode extends Crypto::KeyOperationAlgorithmNode {
WeakRSAAlgorithmNode() {
this.getAlgorithmType() = Crypto::KeyOpAlg::TAsymmetricCipher(Crypto::KeyOpAlg::RSA()) and
this.getKeySizeFixed() < 2048
}
}
from Crypto::KeyOperationNode op, string message
where op.getAKnownAlgorithm() instanceof WeakRSAAlgorithmNode and
message = "Weak RSA instance found with key length <2048"
select op, message