Skip to content

Follow draft-ietf-cose-hpke-23#638

Merged
dajiaji merged 5 commits intomainfrom
follow-core-hpke-15
Mar 11, 2026
Merged

Follow draft-ietf-cose-hpke-23#638
dajiaji merged 5 commits intomainfrom
follow-core-hpke-15

Conversation

@dajiaji
Copy link
Owner

@dajiaji dajiaji commented Sep 1, 2025

No description provided.

@codecov
Copy link

codecov bot commented Sep 1, 2025

Codecov Report

❌ Patch coverage is 89.15663% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.01%. Comparing base (febb85e) to head (dc0d194).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cwt/cose.py 79.54% 9 Missing ⚠️
cwt/recipient_algs/hpke.py 90.76% 6 Missing ⚠️
cwt/utils.py 86.36% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #638      +/-   ##
==========================================
- Coverage   97.34%   97.01%   -0.34%     
==========================================
  Files          32       32              
  Lines        3357     3446      +89     
==========================================
+ Hits         3268     3343      +75     
- Misses         89      103      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cwt/utils.py Outdated
raise ValueError(f"Unsupported or unknown alg: {v}.")
v = algs[v]
else:
v = v.encode("utf-8") if isinstance(v, str) else v
Copy link
Contributor

@achamayou achamayou Sep 1, 2025

Choose a reason for hiding this comment

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

I apologise in advance for offering unsolicited feedback here, which I hope will be useful still.

It is uncommon, and fairly recent, but one soon-to-be standard parameter may only have a tstr value: 260 (payload-location), requested in cose-hash-envelope.

A user passing a protected header {"payload-location": "http://..."} would have their payload-location converted to a bstr by line 191, which although practically harmless, could be rejected by a strict parser/verifier.

Since the code below applies per-key validation, it may be that having per-key conversion logic is desirable. Another edge case may be the use of not-yet supported values for 1 (alg) or 16 (typ), which allow tstr for that purpose. A user may want to pass {"alg": "NEWCRYPTOALGO"}, and a strict verifier may enforce int / tstr and reject a bstr-encoded b"NEWCRYPTOALGO".

dajiaji and others added 3 commits March 12, 2026 08:26
- Split HPKE into integrated (HPKE-0..7) and key encryption (HPKE-0-KE..7-KE)
- Update algorithm IDs and COSE recipient algorithms
- Add hpke_info parameter to encrypt
- Relax key_ops validation for HPKE private keys
- Update README and docs references to draft-23

Made-with: Cursor
@dajiaji dajiaji changed the title Draft: Align with draft-ietf-cose-hpke-15. Follow draft-ietf-cose-hpke-23 Mar 11, 2026
@dajiaji dajiaji force-pushed the follow-core-hpke-15 branch from 2796c14 to dc0d194 Compare March 11, 2026 23:56
@dajiaji dajiaji merged commit 798dcb2 into main Mar 11, 2026
15 of 17 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.

2 participants