Return an error when the case isn't determined

This commit is contained in:
Kamran Khan
2020-12-03 07:50:05 -08:00
parent 943d7af503
commit 71ec2cf937

View File

@@ -81,7 +81,6 @@ pub enum Case {
Lc3DataLe1,
Lc3DataLe2,
Le3,
Unknown,
}
#[cfg_attr(test, derive(Clone, Debug))]
@@ -213,7 +212,7 @@ impl TryFrom<&[u8]> for APDU {
1 => Case::Lc3DataLe1,
2 => Case::Lc3DataLe2,
3 => Case::Le3,
_ => Case::Unknown,
_ => return Err(ApduStatusCode::SW_COND_USE_NOT_SATISFIED),
}),
});
}