Skip to content

fix: upper bound on CertId#161

Merged
domodwyer merged 1 commit into
mainfrom
dom/ski-len
Jul 20, 2026
Merged

fix: upper bound on CertId#161
domodwyer merged 1 commit into
mainfrom
dom/ski-len

Conversation

@domodwyer

Copy link
Copy Markdown
Member

Bound the maximum as well as the minimum CertId.


  • fix: upper bound on CertId (4c82dad)

    Allow a CertId up 64 bytes / 512 bits (allowing for a SHA512 hash in the
    future, though SHA256 is used).
    

Allow a CertId up 64 bytes / 512 bits (allowing for a SHA512 hash in the
future, though SHA256 is used).
Copilot AI review requested due to automatic review settings July 20, 2026 12:33
@domodwyer
domodwyer requested a review from a team as a code owner July 20, 2026 12:33

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 tightens validation for CertId (Subject Key Identifier) by enforcing both minimum and maximum byte-length bounds, preventing overly large identifiers while keeping room for future hash sizes (e.g., SHA-512).

Changes:

  • Introduces a MAX_LENGTH bound (64 bytes) alongside the existing minimum length.
  • Enforces the [MIN_LENGTH, MAX_LENGTH] range in both TryFrom<&[u8]> and TryFrom<Vec<u8>> implementations.
  • Adds a proptest property test to verify both TryFrom implementations accept/reject inputs consistently based on length.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The PR correctly adds an upper bound of 64 bytes to CertId validation, complementing the existing 16-byte minimum. The SmallVec buffer properly handles the expanded range via heap allocation for values >20 bytes, and the property test validates both TryFrom implementations consistently enforce the [16, 64] invariant. No behavioral regressions or memory safety issues detected.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 4c82dad · What is Autotest? · Any feedback? Reach out in #autotest

@domodwyer
domodwyer added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit b85b8e7 Jul 20, 2026
22 checks passed
@domodwyer
domodwyer deleted the dom/ski-len branch July 20, 2026 13:35
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