Skip to contentSkip to conversation

fix(builder): add missing rc.is_warning() check

PATCH New Jarkko Sakkinen 1 participant 1 message Sep 1, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix(builder): add missing rc.is_warning() check

The new tests test_response_build_warning* confirm a failure in the response builder. More precisely, *with_sessions variation fails.

The bug emits from a missing is_warning check in the response, leading to an incorrectly constructed response.

---
 src/message/build.rs |  2 +-
 tests/runner.rs      | 66 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 1 deletion(-)
src/message/build.rs +1 -1
index 9b72f43..4a48228 100644
@@ -98,7 +98,7 @@ where
         TpmSt::NoSessions
     };
 
-    if rc.is_error() {
+    if rc.is_error() || rc.is_warning() {
         (TpmSt::NoSessions as u16).build(writer)?;
         u32::try_from(TPM_HEADER_SIZE)?.build(writer)?;
         rc.value().build(writer)?;
tests/runner.rs +66 -0

78 lines not on this page · raw message

Signature · 1 line
2.39.5