diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a3aa4..86732e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -[Unreleased]: https://github.com/trussed-dev/ctap-types/compare/0.3.0...HEAD +[Unreleased]: https://github.com/trussed-dev/ctap-types/compare/0.3.1...HEAD + +## [0.3.1] 2024-10-18 + +[0.3.1]: https://github.com/trussed-dev/ctap-types/compare/0.3.0...0.3.1 + +### Added + +- Implement `TryFrom>` for `Request<'a>` ## [0.3.0] 2024-08-01 diff --git a/Cargo.toml b/Cargo.toml index e2d70c8..33c4f69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctap-types" -version = "0.3.0" +version = "0.3.1" authors = ["Nicolas Stalder ", "The Trussed developers"] edition = "2021" license = "Apache-2.0 OR MIT" @@ -15,7 +15,7 @@ cosey = "0.3.1" delog = "0.1" heapless = { version = "0.7", default-features = false, features = ["serde"] } heapless-bytes = "0.3" -iso7816 = "0.1.2" +iso7816 = "0.1.3" serde = { version = "1", default-features = false, features = ["derive"] } serde-indexed = "0.1.1" serde_bytes = { version = "0.11.14", default-features = false } diff --git a/src/ctap1.rs b/src/ctap1.rs index 6042dac..0fc6153 100644 --- a/src/ctap1.rs +++ b/src/ctap1.rs @@ -156,8 +156,15 @@ impl Response { impl<'a, const S: usize> TryFrom<&'a iso7816::Command> for Request<'a> { type Error = Error; - #[inline(never)] fn try_from(apdu: &'a iso7816::Command) -> Result { + apdu.as_view().try_into() + } +} + +impl<'a> TryFrom> for Request<'a> { + type Error = Error; + #[inline(never)] + fn try_from(apdu: iso7816::command::CommandView<'a>) -> Result { let cla = apdu.class().into_inner(); let ins = match apdu.instruction() { iso7816::Instruction::Unknown(ins) => ins,