fix(web): construct invalid bootstrap nonces in tests

CodeQL rust/hard-coded-cryptographic-value flagged the malformed
capability literals passed to consume() as a hard-coded nonce.

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
This commit is contained in:
CodeWhale Bot
2026-08-27 11:43:26 -07:00
parent dba563f477
commit 9f854c0056

View File

@@ -374,7 +374,9 @@ mod tests {
#[test]
fn bootstrap_rejects_malformed_or_wrong_capabilities_without_consuming() {
let (state, nonce) = RuntimeWebState::new();
for invalid in ["", "cwwb_short", "cwwb_gggggggggggggggggggggggggggggggg"] {
let too_short = format!("{BOOTSTRAP_PREFIX}short");
let non_hex = format!("{BOOTSTRAP_PREFIX}{}", "g".repeat(32));
for invalid in ["", too_short.as_str(), non_hex.as_str()] {
assert_eq!(state.consume(invalid), Err(BootstrapError::Invalid));
}
let mut wrong = nonce.clone();