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

Error handling for CHALLENGE_AUTH signature generation #182

Closed
rw8896 opened this issue May 21, 2021 · 2 comments
Closed

Error handling for CHALLENGE_AUTH signature generation #182

rw8896 opened this issue May 21, 2021 · 2 comments

Comments

@rw8896
Copy link

rw8896 commented May 21, 2021

The spec requires the message concatenation performed only after a successful completion response.

258 Concatenate() is the standard concatenation function that is performed only after a successful
completion response on the entire request and response contents.

265 ◦ If a response contains an ErrorCode other than ResponseNotReady :
266 No concatenation function is performed on the contents of both the original request and
response.

But the behavior of the current Responder is typically:

SpdmGetResponseFoo()
{
1. validate request
2. append request into managed buffer
3. generate response
4. append response into managed buffer
}

This model didn't handle the scenario when some errors occur after 2), the request shouldn't be appended into the buffer.
It might be better to change the behavior as:

SpdmGetResponseFoo()
{
1. validate request
2. generate response
3. if everything is okay, concatenate request and response and append it into the managed buffer together.
}

(Note that lower layer failures, e.g. errors in MCTP or SMBus causing the response not sent to the requester, are ignored here.)

The current responder code for MEASUREMENT signature generation in the other hand implemented the similar requirement.

SpdmGetResponseMeasurement()
{
1. validate request
2. append request into managed buffer
3. generate response
3-1. reset the buffer if error X occurs
3-2. reset the buffer if error Y occurs
... and so on.
}

But it should be simpler to also apply the proposed model to simplify the flow.

@jyao1
Copy link
Owner

jyao1 commented May 21, 2021

Agree

@jyao1
Copy link
Owner

jyao1 commented Jul 7, 2021

migrate to DMTF/libspdm#24

@jyao1 jyao1 closed this as completed Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants