From 23970378969e4089c1e09cae8e0f69a5f3141d37 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 c004ef9ee..292671b43 100644 --- a/upstairs/src/upstairs.rs +++ b/upstairs/src/upstairs.rs @@ -3489,7 +3489,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 @@ -3607,6 +3607,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(); @@ -3635,14 +3636,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,