From 71ec2cf937260c075222960405f478108cbe0106 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 3 Dec 2020 07:50:05 -0800 Subject: [PATCH] Return an error when the case isn't determined --- src/ctap/apdu.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ctap/apdu.rs b/src/ctap/apdu.rs index 8cff770..07cf136 100644 --- a/src/ctap/apdu.rs +++ b/src/ctap/apdu.rs @@ -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), }), }); }