File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -161,16 +161,19 @@ pub(crate) fn handle_challenge_auth_response<'a>(
161161 . map_err ( |e| ( true , CommandError :: Codec ( e) ) ) ?;
162162 }
163163
164- // This field shall be identical to the Context field of the corresponding request message.
165- // TODO: compare it to the context we sent.
166- // See: src/protocol/common.rs [RequesterContext]
167- let _requester_context = resp_payload
168- . data ( 8 )
169- . map_err ( |e| ( true , CommandError :: Codec ( e) ) ) ?;
164+ // In v1.3 a 8-byte request context was added before the signature field
165+ if ctx. connection_info ( ) . version_number ( ) >= SpdmVersion :: V13 {
166+ // This field shall be identical to the Context field of the corresponding request message.
167+ // TODO: compare it to the context we sent.
168+ // See: src/protocol/common.rs [RequesterContext]
169+ let _requester_context = resp_payload
170+ . data ( 8 )
171+ . map_err ( |e| ( true , CommandError :: Codec ( e) ) ) ?;
170172
171- resp_payload
172- . pull_data ( 8 )
173- . map_err ( |e| ( true , CommandError :: Codec ( e) ) ) ?;
173+ resp_payload
174+ . pull_data ( 8 )
175+ . map_err ( |e| ( true , CommandError :: Codec ( e) ) ) ?;
176+ }
174177
175178 // We have to use this ugly hack to bring the message buffer into the right form to exclude the signature.
176179 // This message buffer thing is totally fucked up...
You can’t perform that action at this time.
0 commit comments