Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ac7b4b

Browse files
committed
Update qldoc
1 parent 058f3af commit 2ac7b4b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

java/ql/src/experimental/Security/CWE/CWE-326/InsufficientKeySize.ql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class KeyPairGeneratorInitConfiguration extends TaintTracking::Configuration {
7474
}
7575
}
7676

77-
/** Holds if a symmetric `KeyGenerator` is initialized with an insufficient key size. */
77+
/** Holds if a symmetric `KeyGenerator` implementing encryption algorithm `type` and initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */
7878
bindingset[type]
7979
predicate hasShortSymmetricKey(MethodAccess ma, string msg, string type) {
8080
ma.getMethod() instanceof KeyGeneratorInitMethod and
@@ -91,10 +91,10 @@ predicate hasShortSymmetricKey(MethodAccess ma, string msg, string type) {
9191
msg = "Key size should be at least 128 bits for " + type + " encryption."
9292
}
9393

94-
/** Holds if an AES `KeyGenerator` is initialized with an insufficient key size. */
94+
/** Holds if an AES `KeyGenerator` initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */
9595
predicate hasShortAESKey(MethodAccess ma, string msg) { hasShortSymmetricKey(ma, msg, "AES") }
9696

97-
/** Holds if an asymmetric `KeyPairGenerator` is initialized with an insufficient key size. */
97+
/** Holds if an asymmetric `KeyPairGenerator` implementing encryption algorithm `type` and initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */
9898
bindingset[type]
9999
predicate hasShortAsymmetricKeyPair(MethodAccess ma, string msg, string type) {
100100
ma.getMethod() instanceof KeyPairGeneratorInitMethod and
@@ -111,24 +111,24 @@ predicate hasShortAsymmetricKeyPair(MethodAccess ma, string msg, string type) {
111111
msg = "Key size should be at least 2048 bits for " + type + " encryption."
112112
}
113113

114-
/** Holds if a DSA `KeyPairGenerator` is initialized with an insufficient key size. */
114+
/** Holds if a DSA `KeyPairGenerator` initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */
115115
predicate hasShortDSAKeyPair(MethodAccess ma, string msg) {
116116
hasShortAsymmetricKeyPair(ma, msg, "DSA")
117117
}
118118

119-
/** Holds if a RSA `KeyPairGenerator` is initialized with an insufficient key size. */
119+
/** Holds if a RSA `KeyPairGenerator` initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */
120120
predicate hasShortRSAKeyPair(MethodAccess ma, string msg) {
121121
hasShortAsymmetricKeyPair(ma, msg, "RSA")
122122
}
123123

124-
/** Holds if an EC `KeyPairGenerator` is initialized with an insufficient key size. */
124+
/** Holds if an EC `KeyPairGenerator` initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */
125125
predicate hasShortECKeyPair(MethodAccess ma, string msg) {
126126
ma.getMethod() instanceof KeyPairGeneratorInitMethod and
127127
exists(
128128
JavaSecurityKeyPairGenerator jpg, KeyPairGeneratorInitConfiguration kc,
129129
DataFlow::PathNode source, DataFlow::PathNode dest, ClassInstanceExpr cie
130130
|
131-
jpg.getAlgoSpec().(StringLiteral).getValue().matches("EC%") and //ECC variants such as ECDH and ECDSA
131+
jpg.getAlgoSpec().(StringLiteral).getValue().matches("EC%") and // ECC variants such as ECDH and ECDSA
132132
source.getNode().asExpr() = jpg and
133133
dest.getNode().asExpr() = ma.getQualifier() and
134134
kc.hasFlowPath(source, dest) and

0 commit comments

Comments
 (0)