Skip to content

Conversation

@werwurm
Copy link
Contributor

@werwurm werwurm commented Sep 3, 2025

Implements marshalling and unmarshalling for DICE service messages using
CBOR encoding.

@werwurm werwurm requested a review from Copilot September 3, 2025 05:16

This comment was marked as outdated.

@werwurm werwurm requested review from Copilot and seidelrj September 3, 2025 05:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements CBOR marshalling and unmarshalling for DICE service messages, establishing the message format and serialization layer for NAT20 service communication. The implementation adds support for various DICE operations including CDI promotion, certificate issuance, and cryptographic signing through a well-defined API.

  • Defines comprehensive message structures for all supported DICE operations
  • Implements CBOR encoding/decoding with proper error handling and validation
  • Provides extensive test coverage for round-trip serialization scenarios

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
include/nat20/service/messages.h Defines message structures and API for DICE service operations
src/service/messages.c Implements CBOR marshalling/unmarshalling with validation logic
src/service/messages.cddl CDDL specification documenting the CBOR message format
src/service/test/messages.cpp Comprehensive test suite covering serialization round-trips and edge cases
src/service/test/test.cpp Basic test runner for the service module
include/nat20/error.h Adds new error codes for message parsing and validation
CMakeLists.txt Integrates service library and tests into build system
.github/license-check/license-config.json Adds license checking for CDDL files
.github/license-check/header-apache2-semicolon.txt License header template for CDDL files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


int main(int argc, char *argv[]) {
::testing::InitGoogleTest(&argc, argv);
std::cout << "Testing libnat20 service..." << std::endl;
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

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

The string 'libnat20' should be 'Libnat20' to match the project naming convention seen elsewhere in the codebase.

Suggested change
std::cout << "Testing libnat20 service..." << std::endl;
std::cout << "Testing Libnat20 service..." << std::endl;

Copilot uses AI. Check for mistakes.
@werwurm werwurm force-pushed the werwurm/cbor_parser branch from 96ca001 to 088e415 Compare September 10, 2025 18:13
@werwurm werwurm force-pushed the werwurm/service_messages branch from fb866a7 to eeb91ba Compare September 10, 2025 18:13
@werwurm werwurm requested review from Copilot and seidelrj September 10, 2025 19:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


n20_error_t n20_msg_promote_request_read(n20_istream_t *istream,
n20_msg_promote_request_t *request) {

Copy link
Contributor

Choose a reason for hiding this comment

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

missed this nit.


n20_error_t n20_msg_issue_cdi_cert_request_read(n20_istream_t *istream,
n20_msg_issue_cdi_cert_request_t *request) {

Copy link
Contributor

Choose a reason for hiding this comment

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

missed this nit.


n20_error_t n20_msg_issue_eca_ee_cert_request_read(n20_istream_t *istream,
n20_msg_issue_eca_ee_cert_request_t *request) {

Copy link
Contributor

Choose a reason for hiding this comment

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

missed this nit.

@github-actions
Copy link

github-actions bot commented Sep 20, 2025

LCOV of commit 1721d1c during lcov-test-coverage-report #36

Summary coverage rate:
  lines......: 96.1% (2420 of 2517 lines)
  functions..: 99.5% (194 of 195 functions)
  branches...: 87.2% (1372 of 1573 branches)

Files changed coverage rate: n/a

@werwurm werwurm requested a review from seidelrj September 22, 2025 20:53
@werwurm werwurm merged commit ee8e8ea into werwurm/cbor_parser Sep 25, 2025
7 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.

3 participants