From 397c6302f79588dfceab92f3d7f0683cad95a58c Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Tue, 2 Jan 2024 09:50:00 -0500 Subject: [PATCH] Fix comments from review --- upstairs/src/upstairs.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/upstairs/src/upstairs.rs b/upstairs/src/upstairs.rs index f536d585c..a80a9fcf5 100644 --- a/upstairs/src/upstairs.rs +++ b/upstairs/src/upstairs.rs @@ -3496,7 +3496,7 @@ pub(crate) mod test { })) .await; - // fake read response from downstairs that will fail decryption + // fake read response from downstairs that will successfully decrypt let mut data = Vec::from([1u8; 512]); let (nonce, tag, hash) = up @@ -3614,6 +3614,7 @@ pub(crate) mod test { ); } + /// Confirms that the encrypted read hash checksum works #[tokio::test] async fn bad_hash_on_encrypted_read_panic() { let mut up = make_encrypted_upstairs(); @@ -3642,14 +3643,7 @@ pub(crate) mod test { .unwrap(); let nonce: [u8; 12] = nonce.into(); - let mut tag: [u8; 16] = tag.into(); - - // alter tag - if tag[3] == 0xFF { - tag[3] = 0x00; - } else { - tag[3] = 0xFF; - } + let tag: [u8; 16] = tag.into(); let responses = Ok(vec![ReadResponse { eid: 0,