diff --git a/attest-data/src/messages.rs b/attest-data/src/messages.rs index 6ceca61..c0ec3db 100644 --- a/attest-data/src/messages.rs +++ b/attest-data/src/messages.rs @@ -215,8 +215,13 @@ pub fn parse_response( return Err(HostToRotError::VersionMismatch); } - if command != expected { - return Err(HostToRotError::UnexpectedCommand); + match command { + RotToHost::HostToRotError(e) => return Err(e), + c => { + if c != expected { + return Err(HostToRotError::UnexpectedCommand); + } + } } Ok(leftover) }