aboutsummaryrefslogtreecommitdiff
path: root/pyasn1
AgeCommit message (Collapse)Author
2022-09-20Disable unused Python 2 variant.main-16kKrzysztof Kosiński
Bug: 245854393 Test: presubmit Change-Id: I234523fd5a3fb27eedb3b2db804997dea418e2cd
2021-02-12[LSC] Add LOCAL_LICENSE_KINDS to external/python/pyasn1Bob Badour
Added SPDX-license-identifier-BSD-2-Clause to: Android.bp pyasn1/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I090be6f6d620fe7331f68b101eb60c18317edbb4
2019-09-04Upgrade python/pyasn1 to v0.4.7Haibo Huang
Exempt-From-Owner-Approval: upgrade library Test: None Change-Id: I32f32feccdfbafdd24e3c9d005c0b22f5527735f
2019-09-01Release 0.4.7Ilya Etingof
2019-08-28Add an afterthought on WITH COMPONENTS constraintIlya Etingof
2019-08-27Add `SET ... WITH COMPONENTS ...` ASN.1 construct support (#171)Ilya Etingof
Added `WithComponentsConstraint` along with related `ComponentPresentConstraint` and `ComponentAbsentConstraint` classes to be used with `Sequence`/`Set` types representing `SET ... WITH COMPONENTS ...` like ASN.1 constructs.
2019-08-25Deprecate `sizeSpec` in favor of `subtypeSpec` (#172)Ilya Etingof
This commit deprecates `subtypeSpec` attributes and keyword argument. It is now recommended to pass `ValueSizeConstraint`, as well as all other constraints, to `subtypeSpec`. By way of the change mentioned above, this commit fixes a design bug in a way of how the items assigned to constructed types are verified. Now if `Asn1Type`-based object is assigned, its compatibility is verified based on having all tags and constraint objects as the type in field definition. When a bare Python value is assigned, then field type object is cloned and initialized with the bare value (constraints verificaton would run at this moment).
2019-08-25Add `isInconsistent` property hook to all constructed types (#170)Ilya Etingof
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.
2019-08-13Fix ConstraintsUnion docstringIlya Etingof
2019-08-13Prepare 0.4.7Ilya Etingof
2019-08-01Upgrade python/pyasn1 to v0.4.6Haibo Huang
Exempt-From-Owner-Approval: Upgrade library Test: None Change-Id: I94305762a92ba908aa8c1f78abdc44bc28e1e53a
2019-07-31Fix failing unit tests on Py25Ilya Etingof
2019-07-31Remove a couple of `except as` statements to benefit old PythonsIlya Etingof
2019-07-13Document base ASN.1 typesIlya Etingof
Also many fixes here and there to docs and docstrings.
2019-07-13Fix Python builtins ReST references in docstringsIlya Etingof
2019-07-13Remove Python `id` from `repr`Ilya Etingof
It seems to clutter representation printout, especially in the rendered docs.
2019-07-13Add exception classes documentationIlya Etingof
Also fix references to exception objects in other docstrings.
2019-07-13Add docstring for `.reset()` and `.clear()` methodsIlya Etingof
2019-07-12Fix to pass decoder `options` to open type decoderIlya Etingof
Prior to this fix, recursively encoded open types won't get fully decoded all the way.
2019-07-12Fix CER/DER encoders to respect open types (#167)Ilya Etingof
* Fix CER/DER encoders to respect open types Added a bunch of unit tests to CER/DER codecs covering open types.
2019-07-12Add `SequenceOf`/`SetOf` list-like slicing support (#168)Ilya Etingof
2019-07-10Upgrade python/pyasn1 to v0.4.5Haibo Huang
Exempt-From-Owner-Approval: Upgrade library Test: build Change-Id: I879edd58806f3b9b7fbf8cc78d02c684b5b336ae
2019-07-09Add more docs on `OpenType` (#166)Ilya Etingof
This change adds more explanations and examples on ASN.1 ANY DEFINED BY syntax (OpenType).
2019-07-06Add `SET|SEQUENCE OF ANY` encoding support (#165)Ilya Etingof
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.
2019-06-30Improve CER/DER encoding of GeneralizedTime (#164)Ilya Etingof
- Added support for subseconds CER/DER encoding edge cases in `GeneralizedTime` codec - Fixed 3-digit fractional seconds value CER/DER encoding of `GeneralizedTime`
2019-06-29Rename pyasn1 unicode exceptionsIlya Etingof
The new exception classes names are `PyAsn1UnicodeDecodeError` and `PyAsn1UnicodeEncodeError`. Also, unit tests added.
2019-06-29Add specific exceptions for String issues (#155)Alex Shafer
This change helps telling unicode-related exceptions from other PyAsn1Error exceptions.
2019-06-28Fix `AnyDecoder` to accept `TagMap` as `asn1Spec` (#152)Ilya Etingof
Fixes `AnyDecoder` to accept `TagMap` as `asn1Spec`. The use-case is to make `AnyDecoder` operational when dumping raw value on error condition is enabled
2019-06-23SequenceOf/SetOf to remain a schema objects (#162)Ilya Etingof
* 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.
2019-06-20Remove invalid escape sequences to get rid of DeprecationWarning in Python3. ↵Harrison
(#161)
2018-12-29Prepare for 0.4.6Ilya Etingof
2018-12-29Release 0.4.5Ilya Etingof
Also extend copyright to the year 2019
2018-12-29Fix defaulted constructed SEQUENCE component initialization (#146)Ilya Etingof
When SEQUENCE has defaulted component of constructed type, recursively instantiate defaulted component and assign instantiated asn1 object to SEQUENCE field.
2018-12-29Fix encoder debugging under Py2Ilya Etingof
2018-08-04Add more debug logging to *ER codecs (#139)Ilya Etingof
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
2018-08-03Refactor debug logging (#138)Ilya Etingof
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.
2018-07-29Fix some typos and prepare for 0.4.5Ilya Etingof
2018-07-26Fix package versionIlya Etingof
2018-07-24Fix Sequence/Set.prettyPrint crashIlya Etingof
When calling `.prettyPrint()` on Sequence/Set components, make sure the component is a value object (not schema) because calling `.prettyPrint` on a schema object is likely to fail.
2018-06-30Fix native encoder type map (#132)Ilya Etingof
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.
2018-06-12Merge commit '4b7961a' into pyasn1_0.4.3android-p-preview-5android-p-preview-4chojoyce
Initial commit of pyasn1 0.4.3 with history. Added: - Android.bp - MODULE_LICENSE_BSD - NOTICE - METADATA Bug: b/80314772 Test: Compiled acloud with pyasn1 and was able to import pyasn1 Change-Id: I5484e8db1f536b214adb8be9b6b7cc5e13354c8e
2018-05-23fix GenerlizedTime.asDateTime() operationIlya Etingof
2018-03-29copyright years extendedIlya Etingof
2018-03-21Prefer https:// URLs where available (#121)Jon Dufresne
2017-12-03NoValue.__repr__() should report object address in hexIlya Etingof
2017-11-23Fixed bad TagSet initializer at OctetString encoder (#107)Ilya Etingof
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
2017-11-23fix to invoke potentially overridden OctetString.prettyOut()Ilya Etingof
2017-11-23imports pep8'edIlya Etingof
2017-11-23relax open type field type check on assignment (#105)Ilya Etingof
2017-11-21cosmetic changes to Sequence.setComponentByPosition()Ilya Etingof