Skip to content

Support for sub-parsers for SEQUENCE/SET OF #30

@vanrein

Description

@vanrein

Quick DER chooses to be simplistic in terms of memory management. Layers built around it, such as LillyDAP may well be smarter.

This means that the one thing Quick DER refuses, namely to parse SEQUENCE OF and SET OF, can be supported with some help of the outer layer. The issue now is to make Quick DER support such outer layers (and test it with LillyDAP).

We could map to a dernode union instead of dercursor for these structures, and initially der_unpack() into the same form as now namely the dercursor in the wire variant of the union; surrounding code in the smarter application can then be mapped to the info form with an array pointer derray and array length count dercnt. The array elements themselves are dernode values once more. It is the application's knowledge when to use the wire form and when to use info. It usually maps one way after der_unpack() and the other way before der_pack().

Finally, the ASN.1 compiler must produce useful definitions that guide the application to the indices and syntaxes of sub-elements -- which must be supportive of a recursive procedure because, for instance, there may be a SEQUENCE OF inside of a SEQUENCE OF. Such recursion would of course apply to each individual element, as the structure is repeating.

Once this is done, we shall consider adding generic code to Quick DER, using a callback for memory allocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions