This commit is contained in:
Alexey
2026-07-06 20:12:36 +03:00
parent a1ebd44cee
commit b8be805aed
8 changed files with 41 additions and 32 deletions
@@ -101,9 +101,11 @@ async fn write_secure_payload(payload_len: usize) -> (MeD2cWriteMode, Vec<u8>) {
fn assert_secure_payload_with_tail_padding(cleartext: &[u8], payload_len: usize) {
let wire_len = secure_wire_len(cleartext);
assert_eq!(cleartext.len(), 4 + wire_len);
assert!(cleartext[4..4 + payload_len]
.iter()
.all(|byte| *byte == 0xa5));
assert!(
cleartext[4..4 + payload_len]
.iter()
.all(|byte| *byte == 0xa5)
);
let padding_len = wire_len
.checked_sub(payload_len)