Skip to content
Snippets Groups Projects
Commit 1feefe26a4ce authored by Ilya Etingof's avatar Ilya Etingof
Browse files

Add `SET|SEQUENCE OF ANY` encoding support

For example:

  AttributeTypeAndValues ::= SEQUENCE {
    type OBJECT IDENTIFIER,
    values SET OF ANY DEFINED BY type
  }

This patch adds support of the above ASN.1 syntax to BER/DER/CER
codecs.

It appears that to implement this feature properly, `SetOf`/`SequenceOf`
pyasn1 types need to have `.componentType` wrapped into something
similar to `NamedType` that `Set`/`Sequence` have. That additional
layer would then carry the open type meta information. Without it,
`Sequence`/`Set` codec needs to signal `SetOf`/`SequenceOf` codec
of the open type being processed, which is a slight hack.

A other inconvenience is that when `SetOf`/`SequenceOf` deal with
an open type component, they should not verify types on component
assignment. Without open type property in `SetOf`/`SequenceOf`,
the code checks for `Any` component type which is another hack.

The above shortcomings should be addressed in the follow up patch.
parent 6f653dabdb1a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment