From 59f01ed3574edba06de3a47edf366f77336c4be2 Mon Sep 17 00:00:00 2001 From: Nicolas Stalder Date: Fri, 14 May 2021 19:01:24 +0200 Subject: [PATCH] Adjust to Trussed object ID cleanup --- src/state.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/state.rs b/src/state.rs index ee91c98..ea4f7af 100644 --- a/src/state.rs +++ b/src/state.rs @@ -3,7 +3,7 @@ use trussed::{ block, Client as TrussedClient, syscall, - types::{ObjectHandle, PathBuf, Location}, + types::{KeyId, PathBuf, Location}, }; use crate::constants::*; @@ -11,9 +11,9 @@ use crate::constants::*; pub type Result = core::result::Result; pub enum Key { - Ed255(ObjectHandle), - P256(ObjectHandle), - X255(ObjectHandle), + Ed255(KeyId), + P256(KeyId), + X255(KeyId), } pub enum PinPolicy { Never, @@ -27,7 +27,7 @@ pub enum TouchPolicy { } pub struct Slot { - pub key: Option, + pub key: Option, pub pin_policy: PinPolicy, // touch_policy: TouchPolicy, } @@ -118,20 +118,20 @@ impl SlotName { pub struct Keys { // 9a "PIV Authentication Key" (YK: PIV Authentication) #[serde(skip_serializing_if = "Option::is_none")] - pub authentication_key: Option, + pub authentication_key: Option, // 9b "PIV Card Application Administration Key" (YK: PIV Management) - pub management_key: ObjectHandle, + pub management_key: KeyId, // 9c "Digital Signature Key" (YK: Digital Signature) #[serde(skip_serializing_if = "Option::is_none")] - pub signature_key: Option, + pub signature_key: Option, // 9d "Key Management Key" (YK: Key Management) #[serde(skip_serializing_if = "Option::is_none")] - pub encryption_key: Option, + pub encryption_key: Option, // 9e "Card Authentication Key" (YK: Card Authentication) #[serde(skip_serializing_if = "Option::is_none")] - pub pinless_authentication_key: Option, + pub pinless_authentication_key: Option, // 0x82..=0x95 (130-149) - pub retired_keys: [Option; 20], + pub retired_keys: [Option; 20], }