From b861e1bba65cf3c26be15d04b929b17b97daf9ad Mon Sep 17 00:00:00 2001 From: Thanh Nguyen Date: Thu, 30 Apr 2026 17:20:11 -0400 Subject: [PATCH] Minor fix --- src/yubikey/piv/management.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/yubikey/piv/management.rs b/src/yubikey/piv/management.rs index f266bf8..c497f95 100644 --- a/src/yubikey/piv/management.rs +++ b/src/yubikey/piv/management.rs @@ -51,8 +51,7 @@ impl CSRSigner { /// Create a new certificate signer based on a Yubikey serial /// and slot pub fn new(serial: u32, slot: SlotId) -> Result { - let mut yk = super::Yubikey::open(serial) - .map_err(|e| Error::InternalYubiKeyError(e.to_string()))?; + let mut yk = super::Yubikey::open(serial)?; let cert = yk.configured(&slot) .map_err(|e| Error::InternalYubiKeyError(format!("failed to read certificate for CSR generation: {}", e)))?; let pki = cert.subject_pki(); @@ -333,7 +332,7 @@ impl super::Yubikey { /// is empty) this will error. pub fn sign_data(&mut self, data: &[u8], alg: AlgorithmId, slot: &SlotId) -> Result> { let cert = self.configured(&slot) - .map_err(|e| Error::InternalYubiKeyError(format!("failed to read certificate for CSR generation: {}", e)))?; + .map_err(|e| Error::InternalYubiKeyError(format!("failed to read slot for signing: {}", e)))?; let pki = cert.subject_pki(); let oid_alg = pki .algorithm