Skip to content

Enforce 10s timeout on Bootz HMAC challenge - #366

Merged
gmacf merged 1 commit into
openconfig:mainfrom
gh4683:add-timeout-hmac
Aug 6, 2026
Merged

Enforce 10s timeout on Bootz HMAC challenge#366
gmacf merged 1 commit into
openconfig:mainfrom
gh4683:add-timeout-hmac

Conversation

@gh4683

@gh4683 gh4683 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Enforce 10s timeout on Bootz HMAC challenge

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a 10-second timeout mechanism for TPM 2.0 HMAC challenges in both the BootstrapStream and BootstrapStreamV1 endpoints. It integrates the clockwork library to allow mockable time tracking during testing and adds a timeout test case for the V1 stream. The review feedback suggests optimizing the timeout checks by storing the elapsed duration in a local variable instead of calculating it twice, and recommends adding a corresponding timeout test case for the V0.6 BootstrapStream endpoint to ensure consistent test coverage.

Comment thread server/service/service.go Outdated
Comment thread server/service/service.go Outdated
Comment thread server/service/service_test.go
@gh4683
gh4683 force-pushed the add-timeout-hmac branch 2 times, most recently from c807a9d to bda68f0 Compare August 6, 2026 00:46
@gh4683
gh4683 force-pushed the add-timeout-hmac branch from bda68f0 to 4da6676 Compare August 6, 2026 00:52
@gmacf
gmacf requested review from Chounoki and gmacf August 6, 2026 00:54
@Chounoki

Chounoki commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

I assume you use a 3rd party library instead of the built-in time package only for the test override capability.

Although I guess that can also be achieved by simply sleeping 11 seconds in the test code with the built-in time package to get the same test result.

@gmacf
gmacf merged commit 2aedf5d into openconfig:main Aug 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants