Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HTTP internal server error when bad attestation object is provided #1913

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

hslatman
Copy link
Member

@hslatman hslatman commented Jul 5, 2024

Fixes #1902

Besides checking for an empty attestation object, which can be the case when a client is not able to provide an attestation and which should fail issuance, there's now an additional check for the CBOR data to be well formed. Effectively that check will be performed twice, as it's done during unmarshaling too, but this way it's easier to surface invalid CBOR data errors to the user. The alternative is to catch specific errors from the cbor package.

Instead of returning an error to the client immediately, the error is stored with the challenge instead, as the challenge won't be solved using the same request body again.

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Jul 5, 2024
@hslatman hslatman added this to the v0.26.3 milestone Jul 5, 2024
@hslatman hslatman requested review from a team and maraino July 5, 2024 13:57
Copy link
Contributor

@maraino maraino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hslatman hslatman merged commit e81512d into master Jul 9, 2024
15 checks passed
@hslatman hslatman deleted the herman/improve-missing-device-attestation-error branch July 9, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Device attestation validation returns 500 for invalid CBOR payload
3 participants