Skip to content

Default to RFC 9864 algorithm IDs and gate deprecated RFC 9053 IDs - #85

Merged
mattia-moffa merged 8 commits into
wolfSSL:mainfrom
aidangarske:rfc9864-fully-specified-algs
Sep 15, 2026
Merged

mattia-moffa merged 8 commits into
wolfSSL:mainfrom
aidangarske:rfc9864-fully-specified-algs

Conversation

@aidangarske

Copy link
Copy Markdown
Member
  • RFC 9864 fully-specified signature IDs (ESP256 -9, ESP384 -51, ESP512 -52, Ed25519 -19, Ed448 -53) are now the default across
    sign, verify, countersign, examples, tools, docs, and CI.
  • The polymorphic RFC 9053 IDs (ES256 -7, ES384 -35, ES512 -36, EdDSA -8) are rejected unless WOLFCOSE_ENABLE_DEPRECATED_ALGS is
    defined; enabling it accepts them on sign and verify.
  • Each fully-specified alg binds its curve: ESP256 with a P-384 key, or Ed25519 with an Ed448 key, is rejected with
    WOLFCOSE_E_COSE_BAD_ALG (covered by new sign/verify/countersign regression tests).
  • Countersignatures dispatch through the shared algorithm predicates, so RFC 9338 countersignatures work with the new IDs; the
    fixed RFC 9338/COSE-WG/RFC 9783 ES256 conformance vectors compile only under WOLFCOSE_ENABLE_DEPRECATED_ALGS.
  • The CLI tool routes polymorphic EdDSA to Ed25519 or Ed448 by key curve across keygen/sign/self-test (including Ed448-only
    builds), and accepts the ES256/EdDSA names only with the deprecated flag.
  • Caller impact: peers still emitting ES256/ES384/ES512/EdDSA require WOLFCOSE_ENABLE_DEPRECATED_ALGS; the Makefile interop
    targets build a separate library with that flag.
  • Tested: default, WOLFCOSE_ENABLE_DEPRECATED_ALGS, and Ed448-only-deprecated builds pass the unit suite, cmdline-test,
    lean-verify, tool-test, and the zero-allocation check.

@aidangarske aidangarske self-assigned this Sep 14, 2026
Copilot AI lite review requested due to automatic review settings September 14, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved CLI dispatch issues affect deprecated EdDSA key generation and algorithm-filter self-tests.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR adopts RFC 9864 signature IDs by default and gates legacy RFC 9053 IDs behind an opt-in macro.

Changes:

  • Adds curve-bound algorithm validation and shared countersignature dispatch.
  • Updates CLI behavior, tests, examples, documentation, and interop builds.
  • Expands CI coverage for default, deprecated-ID, and Ed448-only configurations.
File summaries
File Reviewed change
tools/wolfcose_tool.c CLI parsing, key generation, signing, and self-tests; deprecated EdDSA dispatch issues remain.
tests/test_psa_attestation.c Gates legacy PSA vectors.
tests/test_interop.c Updates interop algorithms and legacy vector handling.
tests/test_cose_examples.c Gates deprecated algorithm examples.
src/wolfcose_sign1.c Adds Sign1 algorithm and curve validation.
src/wolfcose_sign.c Applies validation to multi-signer operations.
src/wolfcose_internal.h Declares shared algorithm predicates.
src/wolfcose_countersign.c Updates countersignature algorithm dispatch.
src/wolfcose_alg.c Centralizes algorithm and curve mappings.
scripts/cmdline-test.sh Updates CLI algorithm coverage.
scripts/check_coverage.sh Reuses coverage checks across configurations.
README.md Documents RFC 9864 defaults.
Makefile Adds deprecated-ID interop builds.
include/wolfcose/wolfcose.h Adds algorithm constants; deprecation wording needs narrowing.
include/wolfcose/settings.h Adds deprecated-algorithm feature gates.
IDE/STM32Cube/wolfcose_test.c Updates embedded test algorithms.
examples/sign1_verify_lean.c Migrates verification example algorithms.
examples/sign1_demo.c Migrates Sign1 demonstration algorithms.
examples/scenarios/sensor_attestation.c Updates attestation algorithm usage.
examples/scenarios/multi_party_approval.c Uses fully specified algorithm IDs.
examples/scenarios/firmware_update.c Updates firmware signing fallback.
examples/lifecycle_demo.c Updates lifecycle algorithm names.
examples/ext_sign_demo.c Updates delegated signing algorithms.
examples/comprehensive/sign_all.c Migrates signing examples.
examples/comprehensive/errors_all.c Updates algorithm error examples.
docs/Testing.md Documents deprecated-mode testing.
docs/STM32Cube.md Updates STM32 guidance.
docs/Project-Structure.md Updates project algorithm references.
docs/MISRA-Compliance.md Updates configuration references.
docs/Message-Types.md Updates message algorithm references.
docs/Macros.md Documents deprecated-algorithm gating.
docs/Home.md Updates project documentation.
docs/Getting-Started.md Updates build and algorithm examples.
docs/API-Reference.md Updates algorithm API requirements.
docs/Algorithms.md Updates supported algorithms; deprecation wording needs narrowing.
.github/workflows/misra-2023.yml Adds deprecated-ID checks.
.github/workflows/misra-2012.yml Adds deprecated-ID checks.
.github/workflows/minimal-build.yml Adds configuration matrix coverage.
.github/workflows/lean-build.yml Adds deprecated and Ed448-only builds.
.github/workflows/coverage.yml Adds default and deprecated-ID coverage.
.github/workflows/cmdline-test.yml Tests updated CLI algorithms.
.github/workflows/build-test.yml Updates build and test workflow coverage.
Review details

Suppressed comments (3)

docs/Algorithms.md:137

  • [Low, CWE-436] The deprecation note at this point also visually scopes over the following PS256/PS384/PS512 entries, although RSA-PSS remains enabled without the deprecated-algorithm macro. Restrict the note to the four ES*/EdDSA constants so this documentation matches the implementation.
/* Deprecated by RFC 9864, opt-in with WOLFCOSE_ENABLE_DEPRECATED_ALGS */

include/wolfcose/wolfcose.h:194

  • [Low, CWE-436] This deprecation comment is immediately followed by the still-supported PS256/PS384/PS512 constants, so it currently reads as if those RSA-PSS algorithms also require WOLFCOSE_ENABLE_DEPRECATED_ALGS; the implementation does not gate them. Limit the comment explicitly to the four ES*/EdDSA IDs so the public API does not misstate which algorithms are deprecated.
    tools/wolfcose_tool.c:1826
  • Medium — the deprecated EdDSA self-test is missing in Ed448-only builds. The new alias is attached only to the WOLFCOSE_HAVE_EDDSA block. When only WOLFCOSE_HAVE_ED448 and the deprecated-ID flag are enabled, test -a EdDSA matches neither block, reports no matching algorithm, and never exercises the Ed448 route. Add the alias to the Ed448 block only when Ed25519 is not compiled, avoiding a duplicate test when both curves are available.
  • Files reviewed: 42/43 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/wolfcose_tool.c Outdated
Comment thread tools/wolfcose_tool.c Outdated
@aidangarske
aidangarske force-pushed the rfc9864-fully-specified-algs branch from 4682e91 to 21fa8e8 Compare September 15, 2026 02:38
@aidangarske
aidangarske marked this pull request as ready for review September 15, 2026 16:05
@aidangarske
aidangarske force-pushed the rfc9864-fully-specified-algs branch from 8e1581c to 7e7193a Compare September 15, 2026 20:22
@aidangarske
aidangarske force-pushed the rfc9864-fully-specified-algs branch from 7e7193a to 3b13061 Compare September 15, 2026 20:29
@mattia-moffa
mattia-moffa merged commit dd6d96d into wolfSSL:main Sep 15, 2026
87 checks passed
@aidangarske
aidangarske deleted the rfc9864-fully-specified-algs branch September 16, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants