mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Python: Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
This commit is contained in:
committed by
GitHub
parent
472ff97561
commit
7b92012edf
@@ -545,7 +545,7 @@ module Cryptography {
|
||||
/** Gets the name of the cryptographic algorithm (for example `"RSA"` or `"AES"`). */
|
||||
string getName() { result = range.getName() }
|
||||
|
||||
/** Gets the argument that specifies size of the key in bits, if available. */
|
||||
/** Gets the argument that specifies the size of the key in bits, if available. */
|
||||
DataFlow::Node getKeySizeArg() { result = range.getKeySizeArg() }
|
||||
|
||||
/**
|
||||
@@ -600,7 +600,7 @@ module Cryptography {
|
||||
/** Gets the name of the cryptographic algorithm (for example `"RSA"`). */
|
||||
abstract string getName();
|
||||
|
||||
/** Gets the argument that specifies size of the key in bits, if available. */
|
||||
/** Gets the argument that specifies the size of the key in bits, if available. */
|
||||
abstract DataFlow::Node getKeySizeArg();
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,12 +77,12 @@ private module CryptodomeModel {
|
||||
}
|
||||
|
||||
/** Gets the argument that specifies the curve to use (a string). */
|
||||
DataFlow::Node getCurveArg() { result in [this.getArgByName("curve")] }
|
||||
DataFlow::Node getCurveArg() { result = this.getArgByName("curve") }
|
||||
|
||||
/** Gets the name of the curve to use, as well as the origin that explains how we obtained this name. */
|
||||
string getCurveWithOrigin(DataFlow::Node origin) {
|
||||
exists(StrConst str | origin = DataFlow::exprNode(str) |
|
||||
origin.(DataFlow::LocalSourceNode).flowsTo(this.getCurveArg()) and
|
||||
origin = this.getCurveArg().getALocalSource() and
|
||||
result = str.getText()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ private module CryptographyModel {
|
||||
|
|
||||
// obtained by manually looking at source code in
|
||||
// https://github.com/pyca/cryptography/blob/cba69f1922803f4f29a3fde01741890d88b8e217/src/cryptography/hazmat/primitives/asymmetric/ec.py#L208-L300
|
||||
curveName = "SECT571R1" and keySize = 570
|
||||
curveName = "SECT571R1" and keySize = 570 // Indeed the numbers do not match.
|
||||
or
|
||||
curveName = "SECT409R1" and keySize = 409
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user