Skip to content

Commit

Permalink
apply patch to v14
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-szabo committed Aug 1, 2024
1 parent cb0c8c4 commit c978d47
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/keyring/ed25519/signing_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ impl TryFrom<&[u8]> for SigningKey {
)
} else if slice.len() == (SigningKey::EXPANDED_BYTE_SIZE + SigningKey::PUBLIC_KEY_BYTE_SIZE) {
// Assume key is little-endian encoded expanded secret key. (Exported from YubiHSM.)
slice[0..32].reverse();
slice[0..SigningKey::EXPANDED_BYTE_SIZE]
let mut slice_copy: [u8; SigningKey::EXPANDED_BYTE_SIZE
+ SigningKey::PUBLIC_KEY_BYTE_SIZE] =
[0; SigningKey::EXPANDED_BYTE_SIZE + SigningKey::PUBLIC_KEY_BYTE_SIZE];
slice_copy.copy_from_slice(slice);
slice_copy[0..32].reverse();
slice_copy[0..SigningKey::EXPANDED_BYTE_SIZE]
.try_into()
.map(|e| SigningKey::Ed25519Expanded(e))

Check failure on line 123 in src/keyring/ed25519/signing_key.rs

View workflow job for this annotation

GitHub Actions / Clippy

redundant closure
.map_err(|_| ErrorKind::InvalidKey.into()
Expand Down

0 comments on commit c978d47

Please sign in to comment.