Skip to content

Commit 7b92012

Browse files
RasmusWLyoff
andauthored
Python: Apply suggestions from code review
Co-authored-by: yoff <[email protected]>
1 parent 472ff97 commit 7b92012

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

python/ql/src/semmle/python/Concepts.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ module Cryptography {
545545
/** Gets the name of the cryptographic algorithm (for example `"RSA"` or `"AES"`). */
546546
string getName() { result = range.getName() }
547547

548-
/** Gets the argument that specifies size of the key in bits, if available. */
548+
/** Gets the argument that specifies the size of the key in bits, if available. */
549549
DataFlow::Node getKeySizeArg() { result = range.getKeySizeArg() }
550550

551551
/**
@@ -600,7 +600,7 @@ module Cryptography {
600600
/** Gets the name of the cryptographic algorithm (for example `"RSA"`). */
601601
abstract string getName();
602602

603-
/** Gets the argument that specifies size of the key in bits, if available. */
603+
/** Gets the argument that specifies the size of the key in bits, if available. */
604604
abstract DataFlow::Node getKeySizeArg();
605605

606606
/**

python/ql/src/semmle/python/frameworks/Cryptodome.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ private module CryptodomeModel {
7777
}
7878

7979
/** Gets the argument that specifies the curve to use (a string). */
80-
DataFlow::Node getCurveArg() { result in [this.getArgByName("curve")] }
80+
DataFlow::Node getCurveArg() { result = this.getArgByName("curve") }
8181

8282
/** Gets the name of the curve to use, as well as the origin that explains how we obtained this name. */
8383
string getCurveWithOrigin(DataFlow::Node origin) {
8484
exists(StrConst str | origin = DataFlow::exprNode(str) |
85-
origin.(DataFlow::LocalSourceNode).flowsTo(this.getCurveArg()) and
85+
origin = this.getCurveArg().getALocalSource() and
8686
result = str.getText()
8787
)
8888
}

python/ql/src/semmle/python/frameworks/Cryptography.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private module CryptographyModel {
3535
|
3636
// obtained by manually looking at source code in
3737
// https://github.com/pyca/cryptography/blob/cba69f1922803f4f29a3fde01741890d88b8e217/src/cryptography/hazmat/primitives/asymmetric/ec.py#L208-L300
38-
curveName = "SECT571R1" and keySize = 570
38+
curveName = "SECT571R1" and keySize = 570 // Indeed the numbers do not match.
3939
or
4040
curveName = "SECT409R1" and keySize = 409
4141
or

0 commit comments

Comments
 (0)