Skip to content

Conversation

@maxtropets
Copy link
Collaborator

@maxtropets maxtropets commented Dec 31, 2025

✅ Long Test passed

Yet another item of #7401.

Uses prefetched endorsements for previous identities to build a trusted key chain, and for each endorsed SeqNo return a corresponding service key.

Therefore, improved the self-signing receipt verification API to exercise the new functionality and support receipts from the past.

Other changes

  • Extended some APIs to allow creating COSE verifiers and EC keys from std::spans
  • Same for base64 API
  • Made the testing COSE receipt endpoint no_auth
  • Extended existing endorsement chain e2e testing (recovery) with targeted receipt fetching and verification

@maxtropets maxtropets added the run-long-test Run Long Test job label Dec 31, 2025
@maxtropets maxtropets marked this pull request as ready for review December 31, 2025 18:46
@maxtropets maxtropets requested a review from a team as a code owner December 31, 2025 18:46
Copilot AI review requested due to automatic review settings December 31, 2025 18:46
Copy link
Contributor

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 verification of COSE receipts from previous service identities (pre-disaster recovery) by building a trusted key chain from endorsements. The key enhancement is the ability to verify historical receipts by resolving the appropriate service identity key for a given transaction sequence number through the endorsement chain.

Key changes:

  • Builds and maintains a trusted key chain from COSE endorsements with integrity verification
  • Extends receipt verification to support historical identities by looking up the appropriate service key for each transaction
  • Adds span-based constructors to crypto APIs (EC public keys, COSE verifiers, base64) for improved flexibility

Reviewed changes

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

Show a summary per file
File Description
tests/recovery.py Adds COSE receipt verification testing to recovery scenarios with retry logic for fetching and verifying receipts at specific transaction IDs
src/node/rpc/network_identity_subsystem.h Implements trusted key chain building and lookup functionality, including get_trusted_identity_for() method to resolve service keys by sequence number
src/node/historical_queries_utils.cpp Updates receipt verification to use trusted identity lookup based on transaction ID rather than only current service identity
src/crypto/openssl/public_key.h Adds span-based constructor for PublicKey_OpenSSL
src/crypto/openssl/ec_public_key.cpp Implements span-based factory function for EC public keys
src/crypto/openssl/cose_verifier.h Declares span-based constructor for COSEKeyVerifier_OpenSSL
src/crypto/openssl/cose_verifier.cpp Implements span-based constructor and factory for COSE verifiers
src/crypto/base64.cpp Adds span-based overload for base64 encoding
samples/apps/logging/logging.cpp Changes COSE receipt endpoint from authenticated to no_auth_required for public access
include/ccf/network_identity_interface.h Adds get_trusted_identity_for() interface method for retrieving service keys by sequence number
include/ccf/historical_queries_utils.h Updates documentation to reflect verification of both current and historical service identities
include/ccf/crypto/ec_public_key.h Documents span-based EC public key factory function
include/ccf/crypto/cose_verifier.h Declares span-based COSE verifier factory function
include/ccf/crypto/base64.h Declares span-based base64 encoding function
doc/schemas/app_openapi.json Removes security requirements from COSE receipt endpoint in OpenAPI schema

@maxtropets maxtropets requested a review from Copilot December 31, 2025 20:10
@maxtropets maxtropets changed the title Verify pre-DR receipts Verify self-issues receipts for all services identities Dec 31, 2025
@maxtropets maxtropets changed the title Verify self-issues receipts for all services identities Verify self-issues receipts for past services identities Dec 31, 2025
@maxtropets maxtropets changed the title Verify self-issues receipts for past services identities Verify self-issued receipts for past services identities Dec 31, 2025
@maxtropets maxtropets changed the title Verify self-issued receipts for past services identities Verify self-issued receipts from before-DRs Dec 31, 2025
@maxtropets maxtropets changed the title Verify self-issued receipts from before-DRs Verify self-issued receipts from previous service identities Dec 31, 2025
@maxtropets maxtropets changed the title Verify self-issued receipts from previous service identities Verify pre-DR self-issued receipts Dec 31, 2025
Copy link
Contributor

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 16 out of 16 changed files in this pull request and generated 4 comments.

@maxtropets maxtropets removed the run-long-test Run Long Test job label Jan 2, 2026
@maxtropets maxtropets enabled auto-merge (squash) January 2, 2026 13:15
@maxtropets maxtropets merged commit 61aff74 into microsoft:main Jan 2, 2026
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.

2 participants