Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
increase sequence_number on receiving encrypted spdm message.
Browse files Browse the repository at this point in the history
fix #178

Signed-off-by: Yang, Longlong <[email protected]>
  • Loading branch information
longlongyang authored and jyao1 committed Dec 14, 2023
1 parent e14d45a commit 37b87e7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions spdmlib/src/common/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,19 +883,19 @@ impl SpdmSession {
app_buffer,
&self.handshake_secret.request_direction,
);
if r.is_ok() {
self.handshake_secret.request_direction.sequence_number += 1
};
if r != Err(SPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW) {
self.handshake_secret.request_direction.sequence_number += 1;
}
r
} else {
let r = self.decode_msg(
secured_buffer,
app_buffer,
&self.handshake_secret.response_direction,
);
if r.is_ok() {
self.handshake_secret.response_direction.sequence_number += 1
};
if r != Err(SPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW) {
self.handshake_secret.response_direction.sequence_number += 1;
}
r
}
}
Expand All @@ -906,19 +906,19 @@ impl SpdmSession {
app_buffer,
&self.application_secret.request_direction,
);
if r.is_ok() {
self.application_secret.request_direction.sequence_number += 1
};
if r != Err(SPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW) {
self.application_secret.request_direction.sequence_number += 1;
}
r
} else {
let r = self.decode_msg(
secured_buffer,
app_buffer,
&self.application_secret.response_direction,
);
if r.is_ok() {
self.application_secret.response_direction.sequence_number += 1
};
if r != Err(SPDM_STATUS_SEQUENCE_NUMBER_OVERFLOW) {
self.application_secret.response_direction.sequence_number += 1;
}
r
}
}
Expand Down

0 comments on commit 37b87e7

Please sign in to comment.