From 681d73095b790314003459136e06acb1e8ec689b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 21 Nov 2023 14:10:44 +0100 Subject: [PATCH] fixup! Implement largeBlobs command --- src/ctap2.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ctap2.rs b/src/ctap2.rs index 36247e7..4fb1da6 100644 --- a/src/ctap2.rs +++ b/src/ctap2.rs @@ -1894,22 +1894,22 @@ impl crate::Authenticator { .try_into() .map_err(|_| Error::PinAuthInvalid)?; - let mut data: Bytes<70> = Bytes::new(); + let mut auth_data: Bytes<70> = Bytes::new(); // 32x 0xff - data.resize(32, 0xff).unwrap(); + auth_data.resize(32, 0xff).unwrap(); // h'0c00' - data.push(0x0c).unwrap(); - data.push(0x00).unwrap(); + auth_data.push(0x0c).unwrap(); + auth_data.push(0x00).unwrap(); // uint32LittleEndian(offset) - data.extend_from_slice(&request.offset.to_le_bytes()) + auth_data.extend_from_slice(&request.offset.to_le_bytes()) .unwrap(); // SHA-256(data) let mut hash_input = Message::new(); hash_input.extend_from_slice(&data).unwrap(); let hash = syscall!(self.trussed.hash(Mechanism::Sha256, hash_input)).hash; - data.extend_from_slice(&hash).unwrap(); + auth_data.extend_from_slice(&hash).unwrap(); - self.verify_pin(&pin_auth, &data)?; + self.verify_pin(&pin_auth, &auth_data)?; } // 6. Validate data length