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

bstr .size with a range not working #228

Open
Limeth opened this issue Jul 14, 2024 · 0 comments
Open

bstr .size with a range not working #228

Limeth opened this issue Jul 14, 2024 · 0 comments

Comments

@Limeth
Copy link

Limeth commented Jul 14, 2024

As per the spec, it should be possible to use ranges to check the length of bstrs.

However, the following CDDL (not complete):

m = { field: bstr .size (16..1000) }

causes the following failure:

error validating at cbor location /"m"/"field": expected uint to be in range 16 <= value <= 1000, got Bytes([69, 165, 171, 144, 138, 177, 37, 69, 76, 17, 10, 115, 225, 54, 69, 118, 72, 158, 102, 133, 111, 170, 68, 43, 220, 43, 1, 47, 98, 192, 160, 178, 75, 141, 146, 180, 3, 38, 108, 173, 2, 7, 134, 57, 96, 148, 242, 57, 67, 136, 186, 144, 46, 216, 153, 85, 132, 95, 185, 211, 82, 87, 239, 142, 104, 234, 129, 80, 77, 3, 136, 238, 106, 116, 130, 225, 41, 22, 112, 124, 165, 99, 47, 113, 181, 109, 226, 169, 42, 33, 100, 217, 12, 206, 119, 180, 130, 39, 49, 214, 25, 220, 85, 161, 74, 31, 195, 12, 62, 232, 100, 126, 83, 52, 37, 15, 230, 249, 5, 94, 87])
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

No branches or pull requests

1 participant