Skip to content

Commit 721070a

Browse files
committed
Rust: Make the Seed case a tiny bit more realistic.
1 parent b86cb6d commit 721070a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

rust/ql/test/query-tests/security/CWE-327/WeakSensitiveDataHashing/CryptographicOperations.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
| test.rs:74:9:74:23 | ...::new(...) | HashingAlgorithm MD5 WEAK |
88
| test.rs:133:26:133:40 | ...::new(...) | HashingAlgorithm MD5 WEAK |
99
| test.rs:156:26:156:40 | ...::new(...) | HashingAlgorithm MD5 WEAK |
10-
| test.rs:176:13:176:23 | ...::new(...) | EncryptionAlgorithm SEED |
10+
| test.rs:176:13:176:24 | ...::new(...) | EncryptionAlgorithm SEED |
1111
| test.rs:199:22:199:32 | ...::new(...) | HashingAlgorithm SHA1 WEAK |
1212
| test.rs:211:13:211:35 | ...::compute(...) | HashingAlgorithm MD5 WEAK inputs:1 |

rust/ql/test/query-tests/security/CWE-327/WeakSensitiveDataHashing/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ struct Seed {
165165
}
166166

167167
impl Seed {
168-
fn new() -> Self {
168+
fn new(seed_value: u64) -> Self {
169169
Seed { }
170170
}
171171
}
172172

173173
fn test_seed() {
174174
// this will be misrecognized as a use of the SEED algorithm, but being a strong
175-
// algorithm there is no query result anyway.
176-
let _ = Seed::new(); // $ Alert[rust/summary/cryptographic-operations]
175+
// algorithm and not sensitive data, there is no query result anyway.
176+
let _ = Seed::new(0); // $ Alert[rust/summary/cryptographic-operations]
177177
}
178178

179179
// ---

0 commit comments

Comments
 (0)