Extract shared HMAC-SHA256 signing utility - #12034
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Extracts shared HMAC-SHA256 signing and constant-time verification while preserving protocol-specific formats.
Changes:
- Adds tested
hmacutilhelpers. - Migrates request and enclave capability verification.
Show a summary per file
| File | Description |
|---|---|
internal/hmacutil/hmacutil.go |
Implements shared HMAC helpers. |
internal/hmacutil/hmacutil_test.go |
Tests signing and verification failures. |
internal/server/hmac.go |
Uses shared helpers for request authentication. |
internal/enclavegithub/capability.go |
Uses shared verification for capabilities. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write leaked through mcpg in this run. The inconclusive status reflects methodology gaps (read-only backend + unauthenticated CLI), not evidence of enforcement failure.
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. The read-only guarantee held in practice for this runtime. The INCONCLUSIVE rating reflects the methodology limits above, not a security failure. Full ReportMCP Tool Catalog (23 tools, all read-only): Part B write attempts (all →
Result file: References: §33183181839
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes succeeded. No security regression detected. References: §33183181791
|
Request authentication and enclave capability validation independently implemented HMAC-SHA256 signing and constant-time verification. This consolidates the cryptographic primitive while preserving each protocol’s canonical message format and encoding.
Shared crypto utility
internal/hmacutilwithSignand constant-timeVerify.Request HMAC authentication
Enclave capabilities
subtle.ConstantTimeComparewith the shared verifier.