Skip to content

Implemention of C509 - #11716

Closed
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:cert_c509
Closed

SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:cert_c509

Conversation

@SparkiDev

Copy link
Copy Markdown
Contributor

Description

CBOR Encoded X.509 Certificates
Decodes and verifies.
Supports ECDSA, RSA, Ed25519 and Ed448
Supports Type 2 - natively signed
Supports Type 3 - CBOR re-encoded X.509

Testing

./configure --enable-c509
./configure --enable-c509 --disable-c509-type3

@SparkiDev SparkiDev self-assigned this Oct 12, 2026
Copilot AI balanced review requested due to automatic review settings October 12, 2026 07:12
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata +108 B, text +14,184 B (+5.1%, 296,764 B / 67,108,864 B, total: 0% used)
  • RAM: bss +49 B, datas +16 B (+0.1%, 58,423 B / 983,040 B, total: 6% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

Copilot AI 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.

🟡 Changes recommended

RSA policy enforcement and several documented API behaviors do not match the implementation.

4 open findings
What changed in this PR

Adds C509 certificate decoding, DER reconstruction, key extraction, and signature verification to wolfCrypt.

Changes:

  • Implements type-2 and optional type-3 C509 support.
  • Adds Autotools, CMake, Zephyr, and Visual Studio integration.
  • Adds API documentation, tests, and CI coverage.
File Description
wolfcrypt/​src/​c509.c Implements C509 parsing and verification.
wolfssl/​wolfcrypt/​c509.h Defines the public C509 API.
wolfcrypt/​test/​test.c Adds comprehensive C509 tests.
wolfcrypt/​test/​test.h Declares the C509 test entry point.
configure.ac Adds Autotools feature options.
CMakeLists.txt Adds CMake feature options.
cmake/​functions.cmake Adds the source to CMake builds.
cmake/​options.h.in Exports C509 feature macros.
src/​include.am Adds the implementation to Autotools builds.
wolfssl/​wolfcrypt/​include.am Installs the public header.
zephyr/​CMakeLists.txt Adds the source to Zephyr builds.
wolfssl.vcxproj Adds the source to Visual Studio.
wolfssl-VS2022.vcxproj Adds the source to VS 2022.
doc/​dox_comments/​header_files/​c509.h Documents the public API.
doc/​ALGORITHM_DEFINES.md Documents C509 configuration macros.
ChangeLog.md Records the new feature.
.github/​workflows/​cmake.yml Tests CMake configurations.
.github/​workflows/​no-malloc.yml Tests no-allocation configurations.
.github/​configs/​os-check-linux.json Adds Linux configuration coverage.

🧠 Review effort: Balanced


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

Comment thread wolfcrypt/src/c509.c Resolved
Comment thread wolfcrypt/src/c509.c Resolved
Comment thread wolfcrypt/src/c509.c Resolved
Comment thread doc/dox_comments/header_files/c509.h Resolved
@SparkiDev
SparkiDev force-pushed the cert_c509 branch 2 times, most recently from 60e96bf to d485ce8 Compare October 12, 2026 08:41
@SparkiDev SparkiDev removed their assignment Oct 29, 2026
@SparkiDev

Copy link
Copy Markdown
Contributor Author

rebased to latest master

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #11716

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/configs/os-check-linux.json, .github/workflows/cmake.yml, .github/workflows/no-malloc.yml, CMakeLists.txt, ChangeLog.md, cmake/functions.cmake, cmake/options.h.in, configure.ac, doc/ALGORITHM_DEFINES.md, doc/dox_comments/header_files/c509.h, src/include.am, wolfcrypt/test/test.h, wolfssl-VS2022.vcxproj, wolfssl.vcxproj, wolfssl/wolfcrypt/include.am, zephyr/CMakeLists.txt
Coverage: 3 of 3 in-scope changed file(s) opened by the reviewer

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Review tier: Max

Comment thread wolfcrypt/test/test.c Resolved

@philljj philljj 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.

merge conflict, fenrir items

Copilot AI 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.

🟡 Changes recommended

C509 verification still permits 2048-bit RSA issuer keys with 128-bit TLS hardening enabled, falling below the required 3072-bit minimum and requested security strength.

1 open issue
4 resolved since last review

Review effort: Balanced

Comment thread wolfssl/wolfcrypt/c509.h Resolved

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #11716

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/configs/os-check-linux.json, .github/workflows/cmake.yml, .github/workflows/no-malloc.yml, CMakeLists.txt, ChangeLog.md, cmake/functions.cmake, cmake/options.h.in, configure.ac, doc/ALGORITHM_DEFINES.md, doc/dox_comments/header_files/c509.h, src/include.am, wolfcrypt/test/test.h, wolfssl-VS2022.vcxproj, wolfssl.vcxproj, wolfssl/wolfcrypt/include.am, zephyr/CMakeLists.txt
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Review tier: Lite

Comment thread wolfcrypt/test/test.c Resolved
@SparkiDev
SparkiDev requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot December 1, 2026 07:35

Copilot AI 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.

🔵 Needs a closer look

Security-sensitive CBOR parsing, signed-DER reconstruction, and multi-algorithm verification require specialist review and independent interoperability and malformed-input validation beyond the supplied API/build integration evidence.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #11716

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/configs/os-check-linux.json, .github/workflows/cmake.yml, .github/workflows/no-malloc.yml, CMakeLists.txt, ChangeLog.md, cmake/functions.cmake, cmake/options.h.in, configure.ac, doc/ALGORITHM_DEFINES.md, doc/dox_comments/header_files/c509.h, src/include.am, wolfcrypt/test/test.h, wolfssl-VS2022.vcxproj, wolfssl.vcxproj, wolfssl/wolfcrypt/include.am, zephyr/CMakeLists.txt
Coverage: 0 of 1 in-scope changed file(s) opened by the reviewer; not opened: wolfssl/wolfcrypt/c509.h

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

@wolfSSL-Fenrir-bot
wolfSSL-Fenrir-bot dismissed stale reviews from themself December 1, 2026 07:39

Fenrir's latest completed scan found no issues; clearing the prior automated change request.

CBOR Encoded X.509 Certificates
Decodes and verifies.
Supports ECDSA, RSA, Ed25519 and Ed448
Supports Type 2 - natively signed
Supports Type 3 - CBOR re-encoded X.509
@SparkiDev

Copy link
Copy Markdown
Contributor Author

Moved code into wolfCOSE:
wolfSSL/wolfCOSE#98

@SparkiDev SparkiDev closed this Dec 2, 2026
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.

5 participants