Skip to content

Commit 48b4884

Browse files
committed
🧹 fix(sidecar): use infallible KeyHandle conversion
`ObjectHandle` -> `KeyHandle` cannot fail, so `try_from` plus an `anyhow::Context` wrapper was dead error handling. clippy's `unnecessary_fallible_conversions` lint made this a hard error under `-D warnings`, which this crate escalates further via `pedantic = "deny"`. Pre-existing on main; left out of the dependency commit to keep that diff scoped to dependencies. Verified on aarch64-linux (rust:1.94-trixie with libtss2-dev, swtpm, tpm2-tools) because tss-esapi-sys ships no aarch64-darwin bindings: cargo clippy --all-targets -- -D warnings exit 0 cargo test 24 passed, 0 failed
1 parent 1e9ae4c commit 48b4884

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sidecar/src/identity.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn load_persistent_key(ctx: &mut Context, handle: u32) -> anyhow::Result<KeyHand
256256
let loaded = ctx
257257
.tr_from_tpm_public(persistent.into())
258258
.with_context(|| format!("loading persistent TPM handle 0x{handle:08x}"))?;
259-
KeyHandle::try_from(loaded).context("converting TPM handle to key handle")
259+
Ok(KeyHandle::from(loaded))
260260
}
261261

262262
fn certificate_spki(cert: &CertificateDer<'_>) -> anyhow::Result<Vec<u8>> {

0 commit comments

Comments
 (0)