Skip to content

Commit 08cc8b8

Browse files
author
Max Schaefer
committed
Autoformat.
1 parent f42bd28 commit 08cc8b8

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

javascript/ql/lib/semmle/javascript/frameworks/CryptoLibraries.qll

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ private module CryptoJS {
353353
input = result.getParameter(0)
354354
}
355355

356-
private API::CallNode getDirectApplication(API::Node input, API::Node algorithmNode, CryptographicAlgorithm algorithm) {
356+
private API::CallNode getDirectApplication(
357+
API::Node input, API::Node algorithmNode, CryptographicAlgorithm algorithm
358+
) {
357359
/*
358360
* ```
359361
* var CryptoJS = require("crypto-js");
@@ -367,6 +369,7 @@ private module CryptoJS {
367369
* An `Hmac`-prefix of <algorithmName> is ignored.
368370
* Also matches where `CryptoJS.<algorithmName>` has been replaced by `require("crypto-js/<algorithmName>")`
369371
*/
372+
370373
algorithmNode = getAlgorithmNode(algorithm) and
371374
result = algorithmNode.getACall() and
372375
input = result.getParameter(0)
@@ -407,7 +410,7 @@ private module CryptoJS {
407410
this = getEncryptionApplication(input, algorithmNode, algorithm)
408411
or
409412
this = getDirectApplication(input, algorithmNode, algorithm)
410-
|
413+
|
411414
instantiation = algorithmNode.asSource()
412415
)
413416
or
@@ -572,6 +575,7 @@ private module HashJs {
572575
* ```
573576
* Also matches where `hash.<algorithmName>()` has been replaced by a more specific require a la `require("hash.js/lib/hash/sha/512")`
574577
*/
578+
575579
init = getAlgorithmNode(algorithm) and
576580
this = init.getAMemberCall("update") and
577581
input = super.getArgument(0)
@@ -762,10 +766,7 @@ private module Bcrypt {
762766
// `require("bcrypt").hash(password);` with minor naming variations
763767
algorithm.matchesName("BCRYPT") and
764768
init = API::moduleImport(["bcrypt", "bcryptjs", "bcrypt-nodejs"]) and
765-
this =
766-
init
767-
.getMember(["hash", "hashSync"])
768-
.getACall() and
769+
this = init.getMember(["hash", "hashSync"]).getACall() and
769770
super.getArgument(0) = input
770771
}
771772

python/ql/src/Security/CWE-327/BrokenCryptoAlgorithm.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ where
2323
)
2424
or
2525
operation.getBlockMode().isWeak() and msgPrefix = "The block mode " + operation.getBlockMode()
26-
select operation, msgPrefix + " (configured $@) is broken or weak, and should not be used.", operation.getInitialization(), "here"
26+
select operation, msgPrefix + " (configured $@) is broken or weak, and should not be used.",
27+
operation.getInitialization(), "here"

ruby/ql/src/queries/security/cwe-327/BrokenCryptoAlgorithm.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ where
2323
)
2424
or
2525
operation.getBlockMode().isWeak() and msgPrefix = "The block mode " + operation.getBlockMode()
26-
select operation, msgPrefix + " (configured $@) is broken or weak, and should not be used.", operation.getInitialization(), "here"
26+
select operation, msgPrefix + " (configured $@) is broken or weak, and should not be used.",
27+
operation.getInitialization(), "here"

0 commit comments

Comments
 (0)