Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Jul 9, 2024
1 parent 341d5ae commit 074b705
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ serde_test = "1.0.176"
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "960e57d9fc0d209308c8e15dc26252bbe1ff6ba8" }
apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" }
ctaphid-dispatch = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", rev = "57cb3317878a8593847595319aa03ef17c29ec5b" }
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "c7a4722b9f414c40ac635c568c595a5ec257082f" }
trussed = { git = "https://github.com/nitrokey/trussed.git", rev = "0ccdd468859ea14b43e2e95790b9712c398ae5e1" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth.git", tag = "v0.3.0"}
trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" }
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.2.1" }
Expand Down
1 change: 0 additions & 1 deletion src/core_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,6 @@ impl<Twi: I2CForT1, D: DelayUs<u32>> Se050Backend<Twi, D> {
Error::FunctionFailed
})?;

p256::ecdsa::Signature::from_der;
let signature_der = ecdsa_der::DerSignature::from_der(res.signature).map_err(|_err| {
error!("Failed to parse DER signature: {_err:?}");
Error::FunctionFailed
Expand Down
2 changes: 2 additions & 0 deletions src/core_api/ecdsa_der.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ impl<'a> DerSignature<'a> {
}

pub fn to_bytes(&self, field_bytes_size: usize) -> impl Iterator<Item = u8> + 'a {
// Required zero padding
let r_begin = field_bytes_size.saturating_sub(self.r.as_bytes().len());
let s_begin = field_bytes_size.saturating_sub(self.s.as_bytes().len());

iter::repeat(0)
.take(r_begin)
.chain(self.r.as_bytes().iter().cloned())
Expand Down

0 comments on commit 074b705

Please sign in to comment.