fix: unlock payload
CI / Rust CI (push) Failing after 41s

This commit is contained in:
2026-10-04 21:01:44 +02:00
parent 94ca90db69
commit d2252fed66
2 changed files with 6 additions and 2 deletions
+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