Skip to content

Commit 31bfc29

Browse files
sgramsjyao1
authored andcommitted
fix(spdmlib/session): clear backup flags and transcript hashes on reset
Extend `SpdmSession::set_default()` to also reset `responder_backup_valid`, `requester_backup_valid`, `th1`, and `th2`. Without these resets, a session struct that is recycled after teardown or reset retains values from the previous connection. An attacker could leverage this leakage to manipulate key updates or poison transcript hashes in future SPDM sessions. Signed-off-by: Stanislaw Grams <stanislaw.grams@intel.com>
1 parent d5cedbf commit 31bfc29

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spdmlib/src/common/session.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ impl SpdmSession {
562562
self.heartbeat_period = 0;
563563
self.secure_spdm_version_sel = SecuredMessageVersion::default();
564564
self.mut_auth_requested = SpdmKeyExchangeMutAuthAttributes::empty();
565+
self.responder_backup_valid = false;
566+
self.requester_backup_valid = false;
567+
self.th1 = SpdmDigestStruct::default();
568+
self.th2 = SpdmDigestStruct::default();
565569
}
566570

567571
pub fn get_session_id(&self) -> u32 {

0 commit comments

Comments
 (0)