Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested CBOR validation fixes #240

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Nested CBOR validation fixes #240

merged 1 commit into from
Feb 11, 2025

Conversation

anweiss
Copy link
Owner

@anweiss anweiss commented Feb 11, 2025

Addresses #224

@anweiss anweiss requested a review from Copilot February 11, 2025 18:56
@anweiss anweiss self-assigned this Feb 11, 2025
@anweiss anweiss added this to the v1.0.0 milestone Feb 11, 2025
Copy link
Contributor

@Copilot 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.

PR Overview

This pull request addresses issue #224 by refining the nested CBOR validation logic. The key changes include combining conditional branches for range checks in CBOR and JSON validators, adding detailed handling for embedded CBOR values (both as direct byte strings and within arrays), and introducing tests to cover valid and invalid nested CBOR scenarios.

Changes

File Description
src/validator/cbor.rs Simplifies conditional checks, refines embedded CBOR decoding for both byte strings and arrays, and adds tests.
src/validator/json.rs Harmonizes range validation conditions for integer and string values to improve clarity in error handling.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/validator/cbor.rs:1969

  • Review the change in tag comparison: the previous cast to u64 ensured type consistency. Verify that removing the cast by using '{ *tag }' does not introduce type mismatches between *tag and *actual_tag.
if { *tag } != *actual_tag {

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@anweiss anweiss merged commit 106f606 into main Feb 11, 2025
17 checks passed
@anweiss anweiss deleted the fix-224 branch March 10, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant