From b5e2eebe53736eb96f3baf5c17ae953261e09d6c Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sat, 6 Jul 2019 14:04:53 +0200 Subject: Add `SET|SEQUENCE OF ANY` encoding support (#165) 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. --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGES.rst') diff --git a/CHANGES.rst b/CHANGES.rst index 448e372..26d4978 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,7 @@ Revision 0.4.6, released XX-06-2019 ----------------------------------- +- Added previously missing `SET OF ANY` construct encoding/decoding support. - Added `omitEmptyOptionals` option which is respected by `Sequence` and `Set` encoders. When `omitEmptyOptionals` is set to `True`, empty initialized optional components are not encoded. Default is `False`. -- cgit v1.2.1