Compare commits

2 Commits
Author SHA1 Message Date
LucasDLTG d2252fed66 fix: unlock payload
CI / Rust CI (push) Failing after 41s
2026-10-04 21:01:44 +02:00
LucasDLTG 94ca90db69 feat: remove hardware test from git hooks
CI / Rust CI (push) Successful in 3m48s
2026-10-04 12:58:28 +02:00
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ repos:
- id: test
name: cargo test
entry: cargo test --all --features hardware-tests -- --include-ignored
entry: cargo test --all -- --include-ignored
language: system
pass_filenames: false
stages: [pre-push]
+1 -1
View File
@@ -148,7 +148,7 @@ pub fn map_response(frame: &Frame) -> Result<DeviceResponseType, ProtocolError>
return Err(ProtocolError::new("Missing authentication result"));
}
if payload[1] != 0x00 && payload[1] != 0x01 {
if payload[0] != 0x00 && payload[1] != 0x01 {
return Err(ProtocolError::new(format!(
"Invalid authentication flag: {:#04x}",
payload[1]
+5 -1
View File
@@ -99,7 +99,11 @@ pub fn build_get_device_flags() -> Vec<u8> {
pub fn build_unlock_device(password: &[u8]) -> Result<Vec<u8>, ValidationError> {
validate_raw_password(password)?;
Ok(build_frame(0x2d, password))
let mut payload = Vec::with_capacity(1 + password.len());
payload.push(0x00);
payload.extend_from_slice(password);
Ok(build_frame(0x2d, &payload))
}
// Command 0x2F