Skip to content

Commit

Permalink
Merge pull request #22 from Nitrokey/postcard
Browse files Browse the repository at this point in the history
Use RsaPublicParts::deserialize
  • Loading branch information
robin-nitrokey authored Apr 25, 2023
2 parents 25060e3 + 3980187 commit b5ccdd8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ SPDX-License-Identifier: CC0-1.0

# Changelog

## Unreleased

## [v0.1.2][] (2023-04-24)

- Use `RsaPublicParts::deserialize` instead of `trussed::postcard_deserialize` for compatibility with recent Trussed changes.

[v0.1.2]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.1.2

## [v0.1.1][] (2023-04-17)

- Fix dependency on trussed-rsa-alloc to use the git tag in the `[patch.crates-io]` section to avoid duplicate downstream dependencies

[v0.1.1]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.1.1

## [v0.1.0][] (2023-04-13)

This initial release contains support for the basic PIV card functionality.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "piv-authenticator"
version = "0.1.1"
version = "0.1.2"
authors = ["Nicolas Stalder <[email protected]>", "Nitrokey GmbH"]
edition = "2021"
license = "LGPL-3.0-only"
Expand Down
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,11 +865,10 @@ impl<'a, T: trussed::Client + AuthClient + trussed::client::Ed255> LoadedAuthent
trussed::types::KeySerialization::RsaParts
))
.serialized_key;
let serialized: RsaPublicParts =
trussed::postcard_deserialize(&tmp).map_err(|_err| {
error!("Failed to parse RSA parts: {:?}", _err);
Status::UnspecifiedNonpersistentExecutionError
})?;
let serialized = RsaPublicParts::deserialize(&tmp).map_err(|_err| {
error!("Failed to parse RSA parts: {:?}", _err);
Status::UnspecifiedNonpersistentExecutionError
})?;
reply.expand(&[0x81])?;
reply.append_len(serialized.n.len())?;
reply.expand(serialized.n)?;
Expand Down

0 comments on commit b5ccdd8

Please sign in to comment.