Skip to content

COSE receipt verification in C++ API #7494

Merged
maxtropets merged 9 commits into
microsoft:mainfrom
maxtropets:f/cose-receipts-verify-api
Dec 8, 2025
Merged

COSE receipt verification in C++ API #7494
maxtropets merged 9 commits into
microsoft:mainfrom
maxtropets:f/cose-receipts-verify-api

Conversation

@maxtropets

@maxtropets maxtropets commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

Two items of #7401.

This adds

  • a (private) unified C++ API for decoding COSE-formatted CCF receipts.
  • a public C++ API to verify COSE-receipt against the current service identity
    • as explained in the umbrella ticket, this will be advanced once pulling up previous identities on the startup gets resolved.

Hence

  • decoding + unit test
  • verifying + end to end test: extended merkle-proof one, now verifies receipt and all its proofs (+cddl)

@maxtropets maxtropets self-assigned this Nov 30, 2025
@maxtropets maxtropets force-pushed the f/cose-receipts-verify-api branch 2 times, most recently from 744b727 to 9698e57 Compare November 30, 2025 19:33
@maxtropets maxtropets force-pushed the f/cose-receipts-verify-api branch from 9698e57 to d7223d4 Compare November 30, 2025 19:42
@maxtropets maxtropets changed the title [WIP] COSE receipt verification in C++ API COSE receipt verification in C++ API Nov 30, 2025
@maxtropets maxtropets marked this pull request as ready for review November 30, 2025 19:48
@maxtropets maxtropets requested a review from a team as a code owner November 30, 2025 19:48
Copilot AI review requested due to automatic review settings November 30, 2025 19:48
@maxtropets maxtropets added the run-long-test Run Long Test job label Nov 30, 2025

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.

Pull request overview

This PR adds C++ APIs for decoding and verifying COSE-formatted CCF receipts. It introduces a private unified C++ API for decoding receipts and a public API to verify receipts against the current service identity.

Key Changes:

  • New decode_ccf_receipt() function for parsing COSE receipts with Merkle proof validation
  • New public verify_cose_receipt() API for signature verification against network identity
  • Extended end-to-end tests to verify receipts and validate CDDL compliance for all proofs

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
src/node/cose_common.h Implements COSE receipt decoding with Merkle proof parsing and root recomputation
src/node/historical_queries_utils.cpp Implements public verification API using decoded receipts
src/node/node_state.h Updates to use new decoding API instead of extracting issuer/subject directly
include/ccf/historical_queries_utils.h Exposes public verify_cose_receipt() API
samples/apps/logging/logging.cpp Adds /log/public/verify_cose_receipt endpoint
tests/e2e_logging.py Extends test to verify COSE receipts with positive and negative test cases
src/crypto/test/cose.cpp Adds unit test for receipt decoding
doc/schemas/app_openapi.json Adds OpenAPI schema for new endpoint
CHANGELOG.md Documents the new API

Comment thread src/node/cose_common.h Outdated
Comment thread src/node/cose_common.h Outdated
Comment thread doc/schemas/app_openapi.json
@maxtropets maxtropets force-pushed the f/cose-receipts-verify-api branch from d7223d4 to 2f13c2f Compare November 30, 2025 19:52
Comment thread include/ccf/historical_queries_utils.h Outdated
Comment thread doc/schemas/app_openapi.json Outdated
Comment thread src/node/cose_common.h
Comment thread samples/apps/logging/logging.cpp Outdated
Comment thread tests/e2e_logging.py
Comment thread tests/e2e_logging.py
Comment thread src/node/cose_common.h
Comment thread src/node/cose_common.h Outdated
@maxtropets maxtropets removed the run-long-test Run Long Test job label Dec 5, 2025
Comment thread include/ccf/historical_queries_utils.h
Comment thread src/crypto/openssl/cose_sign.h Outdated
Comment thread src/node/cose_common.h Outdated
Comment thread src/node/cose_common.h Outdated
Comment thread src/node/historical_queries_utils.cpp
Comment thread src/node/cose_common.h

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Comment thread src/node/cose_common.h
Comment thread samples/apps/logging/logging.cpp
Comment thread src/node/cose_common.h
Comment thread tests/e2e_logging.py Outdated
maxtropets and others added 2 commits December 5, 2025 16:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@maxtropets maxtropets merged commit 1d929c0 into microsoft:main Dec 8, 2025
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.

4 participants