Age | Commit message (Collapse) | Author |
|
Added `isInconsistent` property to all constructed types. This property
conceptually replaces `verifySizeSpec` method to serve a more general
purpose e.g. ensuring all required fields are in a good shape. By
default this check invokes subtype constraints verification and is run
by codecs on value de/serialisation.
|
|
Also many fixes here and there to docs and docstrings.
|
|
|
|
Also fix references to exception objects in other docstrings.
|
|
Prior to this fix, recursively encoded open types won't get
fully decoded all the way.
|
|
* Fix CER/DER encoders to respect open types
Added a bunch of unit tests to CER/DER codecs covering open types.
|
|
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.
|
|
- Added support for subseconds CER/DER encoding edge cases in
`GeneralizedTime` codec
- Fixed 3-digit fractional seconds value CER/DER encoding of
`GeneralizedTime`
|
|
Fixes `AnyDecoder` to accept `TagMap` as `asn1Spec`.
The use-case is to make `AnyDecoder` operational when
dumping raw value on error condition is enabled
|
|
* Add `omitEmptyOptionals` encoder option
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`.
* Change `SequenceOf`/`SetOf` behaviour
- New elements to `SequenceOf`/`SetOf` objects can now be added at any
position - the requirement for the new elements to reside at the end
of the existing ones (i.e. s[len(s)] = 123) is removed.
- Removed default initializer from `SequenceOf`/`SetOf` types to ensure
consistent behaviour with the rest of ASN.1 types. Before this change,
`SequenceOf`/`SetOf` instances immediately become value objects
behaving like an empty list. With this change, `SequenceOf`/`SetOf`
objects remain schema objects unless a component is added or
`.clear()` is called.
- Added `.reset()` method to all constructed types to turn value object
into a schema object.
|
|
Also extend copyright to the year 2019
|
|
|
|
More debug logging added to BER family of codecs to
ease encoding problems troubleshooting.
Also:
* code layout made a bit more sparse
* potential bug in open type decoding in indefinite mode
fixed
|
|
Debug logging refactored for more efficiency when
disabled and for more functionality when in use.
Specifically, the global LOG object can easily be used
from any function/method, not just from codec main loop
as it used to be.
|
|
|
|
The type map should include all ASN.1 types rather
than just ambiguous ones for performance reasons.
Incomplete type ID map triggers building a new
TagSet out of the value being encoded. If that
value does not have base tags set, that leads to
a crash.
|
|
|
|
|
|
localize explicit tag slitting to chunked mode at OctetString and BitString encoders
The inner chunks tagging logic is to be researched -- I'm not certain it works as it supposed to
|
|
|
|
|
|
* __str__() of ASN.1 types reworked to serve instead of .prettyPrint()
Related changes: `str()` on enumerations and boolean will return
a string label rather than a number.
|
|
|
|
|
|
|
|
|
|
|
|
* minor fixes to RsT docstrings
* more explanations in the docs, better linkage
* cosmetic fixes to NamedValues() docstring
|
|
* rearranged `.clone()` and `.subtype()` docstrings
* legacy Asn1ItemBase.prettyPrinter() method removed
|
|
|
|
|
|
Fix to encoder to omit empty substrate only for constructed types
|
|
* `None` legacy initializer support removed
* Default value for `Null` removed
|
|
|
|
Docs rearranged, simplified and reworded, Sphinx theme changed.
|
|
|
|
ASN.1 encoders can operate on pure-Python types
Also, BitString decoder performance improvement
|
|
Also EOO encoder call replaced with a constant outcome
|
|
|
|
|
|
|
|
|
|
Also fixed a couple of crashes in debug messages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|