From d76f90ca9e10cd7cec4c6e72cd7cf30206726cdd Mon Sep 17 00:00:00 2001 From: "Zhidong Peng (HE/HIM)" Date: Thu, 24 Jul 2025 13:12:51 -0700 Subject: [PATCH] move update_current_secure_channel_state before reportting attest the key. --- proxy_agent/src/key_keeper.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/proxy_agent/src/key_keeper.rs b/proxy_agent/src/key_keeper.rs index 67e35af5..19170e15 100644 --- a/proxy_agent/src/key_keeper.rs +++ b/proxy_agent/src/key_keeper.rs @@ -397,6 +397,11 @@ impl KeyKeeper { } let state = status.get_secure_channel_state(); + let secure_channel_state_updated = self + .key_keeper_shared_state + .update_current_secure_channel_state(state.to_string()) + .await; + // check if need fetch the key if state != DISABLE_STATE && (status.keyGuid.is_none() // key has not latched yet @@ -523,12 +528,8 @@ impl KeyKeeper { } } - // update the current secure channel state if different - match self - .key_keeper_shared_state - .update_current_secure_channel_state(state.to_string()) - .await - { + // update redirect policy if current secure channel state updated + match secure_channel_state_updated { Ok(updated) => { if updated { // update the redirector policy map