Wrapping EverCBOR#7533
Merged
maxtropets merged 10 commits intomicrosoft:mainfrom Dec 26, 2025
Merged
Conversation
e80864b to
24b02d3
Compare
achamayou
reviewed
Dec 16, 2025
92dc7d0 to
f8c95f0
Compare
f8c95f0 to
fe60567
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the direct use of EverCBOR with a new CBOR wrapper abstraction (ccf::cbor). The primary purpose is to simplify CBOR parsing operations throughout the codebase by providing a higher-level, type-safe API.
Key Changes:
- Introduces a new CBOR wrapper library (
src/crypto/cbor.handsrc/crypto/cbor.cpp) that encapsulates EverCBOR operations - Refactors UVM endorsement parsing to use the new wrapper, significantly reducing code complexity (from ~400 lines to ~100 lines in the decode functions)
- Updates error handling to use the new
CBORDecodeErrortype consistently
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/crypto/cbor.h | Defines the new CBOR wrapper API with types and parsing functions |
| src/crypto/cbor.cpp | Implements the CBOR wrapper, including parsing and value extraction methods |
| src/node/uvm_endorsements.cpp | Refactors protected header decoding to use the new CBOR wrapper instead of raw EverCBOR calls |
| cmake/crypto.cmake | Adds the new cbor.cpp to the build configuration |
Comments suppressed due to low confidence (1)
src/node/uvm_endorsements.cpp:343
- Missing closing brace for the
namespace ccfblock. The namespace opened at line 9 should be closed after line 168.
}
}
fe60567 to
de8463e
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
achamayou
reviewed
Dec 16, 2025
eddyashton
reviewed
Dec 16, 2025
eddyashton
reviewed
Dec 16, 2025
achamayou
reviewed
Dec 16, 2025
achamayou
reviewed
Dec 16, 2025
cjen1-msft
reviewed
Dec 16, 2025
achamayou
reviewed
Dec 16, 2025
achamayou
reviewed
Dec 16, 2025
achamayou
approved these changes
Dec 16, 2025
Co-authored-by: Amaury Chamayou <amaury@xargs.fr>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This's purely reading CBORs, and lacking more exhausting tests, but is a good starting point, maybe?