microsoft / scitt-ccf-ledger

Supply Chain Integrity Transparency and Trust ledger application using Confidential Consortium Framework (CCF)
MIT License
35 stars 18 forks source link

Fix CBOR encoder buffer overflow for large claims #196

Closed andpiccione closed 4 months ago

andpiccione commented 4 months ago

Fetching a large claim with an embedded receipt can result in an error if the size of the claim + the size of the receipt payload exceeds the size allocated to the CBOR encoder buffer (default to 10KB).

This PR fixes the issue by initializing a dynamic buffer size proportionally to the size of the claim and the receipt when embedding a receipt into a claim entry. Other relevant changes included: