Skip to content

Problem validating byte strings with .abnfb #190

@stevenj

Description

@stevenj

I am having trouble validating byte strings with the .abnf RFC9165 extension.

This is my CDDL Definition:

; Binary ABNF Test Schema

test_cbor = {
  61285: sub_map
}

sub_map = {
  1: signature_abnf
}

signature = bytes .size 64

signature_abnf = signature .abnfb '
ANYDATA

ANYDATA = *OCTET

OCTET =  %x00-FF
'

Attached are the test case files.

Command I am running:

cddl validate --cddl abnf_test.cddl --cbor abnf_test.cbor

Using it as defined in these test files gives me:

[INFO] Root type for validation: test_cbor
[ERROR] Validation of "abnf_test.cbor" failed: error validating at cbor location /61285/1: unsupported data type for validating cbor, got '
ANYDATA

ANYDATA = *OCTET

OCTET =  %x00-FF
'

But I do not see any issue with the definition after reading the RFC many times.

If I replace signature_abnf in the sub_map with just signature the data validates.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions