COSE HPKE Support - #70
Draft
aidangarske wants to merge 11 commits into
Draft
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces new cryptographic message parsing and key-management paths for attacker-controlled inputs, warranting final human security review despite strong gating and test additions.
Pull request overview
Adds experimental (opt-in) COSE-HPKE P0 support to wolfCOSE, including integrated Encrypt0 HPKE-0 and multi-recipient Encrypt HPKE-0-KE, with build-time acknowledgement gating and supporting tool/test/docs/CI coverage.
Changes:
- Introduces HPKE-0 integrated Encrypt0 encrypt/decrypt APIs and HPKE-0-KE recipient key-encryption support inside
wc_CoseEncrypt_{Encrypt,Decrypt}. - Extends
wolfcose_toolwith HPKE keygen/export and HPKE encrypt/decrypt commands, plus CLI self-tests and negative-path hardening for key output paths (POSIX). - Adds an HPKE example program, dedicated experimental HPKE CI workflow, and documentation for build/validation and experimental feature status.
File summaries
| File | Description |
|---|---|
| tools/wolfcose_tool.c | Adds HPKE CLI commands, HPKE keygen with guarded output handling, and HPKE round-trip self-tests. |
| src/wolfcose.c | Implements HPKE P0 primitives, HPKE header parsing support, and HPKE-0/HPKE-0-KE encryption/decryption logic. |
| scripts/cmdline-test.sh | Adds opt-in HPKE CLI coverage and negative-path tests gated by EXPECT_HPKE. |
| Makefile | Adds hpke demo target, HPKE-aware experimental gates, and strict C99 HPKE compilation lane. |
| include/wolfcose/wolfcose.h | Publishes draft HPKE constants and integrated Encrypt0 HPKE API declarations. |
| include/wolfcose/settings.h | Adds experimental acknowledgement + fine-grained HPKE enable/disable macros and backend requirements. |
| examples/hpke_demo.c | New example demonstrating HPKE-0 Encrypt0 and HPKE-0-KE multi-recipient Encrypt flows. |
| docs/Testing.md | Documents opt-in HPKE test/build workflow and coverage expectations. |
| docs/Macros.md | Documents COSE-HPKE experimental gates and links to experimental status page. |
| docs/Home.md | Adds navigation entry for Experimental features. |
| docs/Getting-Started.md | Adds HPKE backend prerequisites and quickstart usage for HPKE demo/tool. |
| docs/Experimental.md | New page tracking experimental feature status, draft versioning, and graduation plan. |
| docs/_Sidebar.md | Adds Experimental page to docs sidebar. |
| .github/workflows/cose-hpke.yml | New CI workflow validating HPKE unit tests, example, strict C99 lane, and CLI commands. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4