diff --git a/crates/rns-ratkey/src/apdu.rs b/crates/rns-ratkey/src/apdu.rs index 1b63b23..a8178d2 100644 --- a/crates/rns-ratkey/src/apdu.rs +++ b/crates/rns-ratkey/src/apdu.rs @@ -743,7 +743,7 @@ mod tests { // A 200-byte "cert" (DER SEQUENCE header) forces long-form lengths, wrapped // as the PIV cert object: 53 L { 70 L 71 01 00 FE 00 }. let mut cert = vec![0x30, 0x81, 0xC5]; - cert.extend(std::iter::repeat(0xAB).take(197)); + cert.extend(std::iter::repeat_n(0xAB, 197)); let mut inner = vec![0x70, 0x81, cert.len() as u8]; inner.extend_from_slice(&cert); inner.extend_from_slice(&[0x71, 0x01, 0x00, 0xFE, 0x00]); diff --git a/crates/rns-ratkey/src/attestation.rs b/crates/rns-ratkey/src/attestation.rs index c197193..b9f8193 100644 --- a/crates/rns-ratkey/src/attestation.rs +++ b/crates/rns-ratkey/src/attestation.rs @@ -965,7 +965,7 @@ mod tests { &leaf.der, &sub.der, &[anchor_of(&root)], - &[sub.cert.clone()], + std::slice::from_ref(&sub.cert), now(), ); assert!(res.is_ok(), "valid synthetic chain must verify: {res:?}"); @@ -985,7 +985,7 @@ mod tests { &tampered_der, &sub.der, &[anchor_of(&root)], - &[sub.cert.clone()], + std::slice::from_ref(&sub.cert), now(), ); assert!( @@ -1051,7 +1051,7 @@ mod tests { &leaf.der, &sub.der, &[anchor_of(&root)], - &[sub.cert.clone()], + std::slice::from_ref(&sub.cert), now(), ); assert!(matches!(res, Err(ChainError::Expired)), "got {res:?}"); diff --git a/crates/rns-ratkey/src/hardware.rs b/crates/rns-ratkey/src/hardware.rs index 0c35b9b..838b1a2 100644 --- a/crates/rns-ratkey/src/hardware.rs +++ b/crates/rns-ratkey/src/hardware.rs @@ -58,11 +58,10 @@ impl IdentityBackend for MockPivSession { self.ecdh_x25519(slot, peer_pub) } fn read_ed25519_public(&mut self, slot: u8) -> Result<[u8; 32], RatkeyError> { - // Shared borrow so only the inherent `&self` method applies (not this trait method). - (&*self).read_ed25519_public(slot) + MockPivSession::read_ed25519_public(self, slot) } fn read_x25519_public(&mut self, slot: u8) -> Result<[u8; 32], RatkeyError> { - (&*self).read_x25519_public(slot) + MockPivSession::read_x25519_public(self, slot) } fn is_connected(&self) -> bool { self.is_connected()