[Python-modules-commits] [pyasn1] 01/11: New upstream release.

Vincent Bernat bernat at moszumanska.debian.org
Tue Dec 26 07:22:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

bernat pushed a commit to annotated tag debian/0.4.2-1
in repository pyasn1.

commit 3dca0b5baaa51c70eabd57c2388ff2582be2ff68
Author: Vincent Bernat <bernat at debian.org>
Date:   Tue Dec 26 07:23:59 2017 +0100

    New upstream release.
---
 CHANGES.txt => CHANGES.rst                         |  289 +-
 LICENSE.txt => LICENSE.rst                         |    2 +-
 MANIFEST.in                                        |    8 +-
 PKG-INFO                                           |   21 +-
 README.md                                          |  184 +
 README.txt                                         |   67 -
 THANKS.txt                                         |   10 -
 TODO.rst                                           |   92 +
 TODO.txt                                           |   36 -
 doc/codecs.html                                    |  503 ---
 doc/constraints.html                               |  478 ---
 doc/constructed.html                               |  377 ---
 doc/intro.html                                     |  156 -
 doc/pyasn1-tutorial.html                           | 2405 -------------
 doc/scalar.html                                    |  794 -----
 doc/tagging.html                                   |  233 --
 docs/Makefile                                      |  192 ++
 docs/source/.static/logo.svg                       |   95 +
 docs/source/changelog.rst                          |    6 +
 docs/source/conf.py                                |  326 ++
 docs/source/contents.rst                           |  161 +
 docs/source/download.rst                           |   27 +
 docs/source/example-use-case.rst                   |  193 ++
 docs/source/license.rst                            |    6 +
 docs/source/pyasn1/codec/ber/contents.rst          |    7 +
 docs/source/pyasn1/codec/cer/contents.rst          |    7 +
 docs/source/pyasn1/codec/der/contents.rst          |    7 +
 docs/source/pyasn1/codec/native/contents.rst       |    7 +
 docs/source/pyasn1/contents.rst                    |  214 ++
 docs/source/pyasn1/type/char/bmpstring.rst         |   19 +
 docs/source/pyasn1/type/char/contents.rst          |   30 +
 docs/source/pyasn1/type/char/generalstring.rst     |   20 +
 docs/source/pyasn1/type/char/graphicstring.rst     |   20 +
 docs/source/pyasn1/type/char/ia5string.rst         |   19 +
 docs/source/pyasn1/type/char/iso646string.rst      |   19 +
 docs/source/pyasn1/type/char/numericstring.rst     |   19 +
 docs/source/pyasn1/type/char/printablestring.rst   |   20 +
 docs/source/pyasn1/type/char/t61string.rst         |   19 +
 docs/source/pyasn1/type/char/teletexstring.rst     |   21 +
 docs/source/pyasn1/type/char/universalstring.rst   |   19 +
 docs/source/pyasn1/type/char/utf8string.rst        |   19 +
 docs/source/pyasn1/type/char/videotexstring.rst    |   20 +
 docs/source/pyasn1/type/char/visiblestring.rst     |   20 +
 .../type/constraint/constraintsexclusion.rst       |   10 +
 .../type/constraint/constraintsintersection.rst    |   10 +
 .../pyasn1/type/constraint/constraintsunion.rst    |   10 +
 .../pyasn1/type/constraint/containedsubtype.rst    |   10 +
 docs/source/pyasn1/type/constraint/contents.rst    |   67 +
 .../pyasn1/type/constraint/permittedalphabet.rst   |   10 +
 docs/source/pyasn1/type/constraint/singlevalue.rst |   10 +
 docs/source/pyasn1/type/constraint/valuerange.rst  |   10 +
 docs/source/pyasn1/type/constraint/valuesize.rst   |   10 +
 docs/source/pyasn1/type/namedtype/contents.rst     |   40 +
 .../pyasn1/type/namedtype/defaultednamedtype.rst   |   20 +
 docs/source/pyasn1/type/namedtype/namedtype.rst    |   20 +
 docs/source/pyasn1/type/namedtype/namedtypes.rst   |   15 +
 .../pyasn1/type/namedtype/optionalnamedtype.rst    |   20 +
 docs/source/pyasn1/type/namedval/contents.rst      |   43 +
 docs/source/pyasn1/type/namedval/namedval.rst      |   13 +
 docs/source/pyasn1/type/opentype/contents.rst      |   40 +
 docs/source/pyasn1/type/opentype/opentype.rst      |   17 +
 docs/source/pyasn1/type/tag/contents.rst           |   54 +
 docs/source/pyasn1/type/tag/tag.rst                |   18 +
 docs/source/pyasn1/type/tag/tagmap.rst             |   14 +
 docs/source/pyasn1/type/tag/tagset.rst             |   14 +
 docs/source/pyasn1/type/univ/any.rst               |   22 +
 docs/source/pyasn1/type/univ/bitstring.rst         |   17 +
 docs/source/pyasn1/type/univ/boolean.rst           |   17 +
 docs/source/pyasn1/type/univ/choice.rst            |   19 +
 docs/source/pyasn1/type/univ/contents.rst          |   38 +
 docs/source/pyasn1/type/univ/enumerated.rst        |   18 +
 docs/source/pyasn1/type/univ/integer.rst           |   19 +
 docs/source/pyasn1/type/univ/null.rst              |   17 +
 docs/source/pyasn1/type/univ/objectidentifier.rst  |   17 +
 docs/source/pyasn1/type/univ/octetstring.rst       |   19 +
 docs/source/pyasn1/type/univ/real.rst              |   17 +
 docs/source/pyasn1/type/univ/sequence.rst          |   19 +
 docs/source/pyasn1/type/univ/sequenceof.rst        |   19 +
 docs/source/pyasn1/type/univ/set.rst               |   20 +
 docs/source/pyasn1/type/univ/setof.rst             |   19 +
 docs/source/pyasn1/type/useful/contents.rst        |   15 +
 docs/source/pyasn1/type/useful/generalizedtime.rst |   37 +
 .../source/pyasn1/type/useful/objectdescriptor.rst |   20 +
 docs/source/pyasn1/type/useful/utctime.rst         |   34 +
 pyasn1.egg-info/PKG-INFO                           |   21 +-
 pyasn1.egg-info/SOURCES.txt                        |  153 +-
 pyasn1/__init__.py                                 |    3 +-
 pyasn1/codec/ber/decoder.py                        | 1488 +++++---
 pyasn1/codec/ber/encoder.py                        |  782 +++--
 pyasn1/codec/ber/eoo.py                            |   24 +-
 pyasn1/codec/cer/decoder.py                        |  101 +-
 pyasn1/codec/cer/encoder.py                        |  344 +-
 pyasn1/codec/der/decoder.py                        |   91 +-
 pyasn1/codec/der/encoder.py                        |  115 +-
 {test => pyasn1/codec/native}/__init__.py          |    0
 pyasn1/codec/native/decoder.py                     |  214 ++
 pyasn1/codec/native/encoder.py                     |  229 ++
 pyasn1/compat/binary.py                            |   31 +-
 pyasn1/compat/calling.py                           |   20 +
 pyasn1/compat/dateandtime.py                       |   22 +
 pyasn1/compat/integer.py                           |  110 +
 pyasn1/compat/octets.py                            |   34 +-
 pyasn1/compat/string.py                            |   26 +
 pyasn1/debug.py                                    |  105 +-
 pyasn1/error.py                                    |   32 +-
 pyasn1/type/base.py                                |  739 +++-
 pyasn1/type/char.py                                |  331 +-
 pyasn1/type/constraint.py                          |  512 ++-
 pyasn1/type/error.py                               |   10 +-
 pyasn1/type/namedtype.py                           |  628 +++-
 pyasn1/type/namedval.py                            |  225 +-
 pyasn1/type/opentype.py                            |   75 +
 pyasn1/type/tag.py                                 |  381 ++-
 pyasn1/type/tagmap.py                              |  148 +-
 pyasn1/type/univ.py                                | 3561 +++++++++++++++-----
 pyasn1/type/useful.py                              |  188 +-
 requirements.txt                                   |    0
 setup.cfg                                          |    4 +-
 setup.py                                           |  104 +-
 test/codec/ber/suite.py                            |   22 -
 test/codec/ber/test_decoder.py                     |  727 ----
 test/codec/ber/test_encoder.py                     |  483 ---
 test/codec/cer/suite.py                            |   22 -
 test/codec/cer/test_decoder.py                     |   41 -
 test/codec/cer/test_encoder.py                     |  176 -
 test/codec/der/suite.py                            |   22 -
 test/codec/der/test_decoder.py                     |   31 -
 test/codec/der/test_encoder.py                     |   51 -
 test/codec/suite.py                                |   29 -
 test/suite.py                                      |   26 -
 test/type/suite.py                                 |   20 -
 test/type/test_namedtype.py                        |   91 -
 test/type/test_namedval.py                         |   22 -
 test/type/test_univ.py                             |  601 ----
 {test/codec => tests}/__init__.py                  |    0
 tests/__main__.py                                  |   22 +
 tests/base.py                                      |   23 +
 {test/codec/ber => tests/codec}/__init__.py        |    0
 tests/codec/__main__.py                            |   22 +
 {test/codec/cer => tests/codec/ber}/__init__.py    |    0
 tests/codec/ber/__main__.py                        |   20 +
 tests/codec/ber/test_decoder.py                    | 1435 ++++++++
 tests/codec/ber/test_encoder.py                    | 1377 ++++++++
 {test/codec/der => tests/codec/cer}/__init__.py    |    0
 tests/codec/cer/__main__.py                        |   20 +
 tests/codec/cer/test_decoder.py                    |   71 +
 tests/codec/cer/test_encoder.py                    |  723 ++++
 {test/type => tests/codec/der}/__init__.py         |    0
 tests/codec/der/__main__.py                        |   20 +
 tests/codec/der/test_decoder.py                    |   79 +
 tests/codec/der/test_encoder.py                    |  409 +++
 {test => tests/codec/native}/__init__.py           |    0
 tests/codec/native/__main__.py                     |   19 +
 tests/codec/native/test_decoder.py                 |  125 +
 tests/codec/native/test_encoder.py                 |  146 +
 {test => tests/compat}/__init__.py                 |    0
 tests/compat/__main__.py                           |   21 +
 tests/compat/test_binary.py                        |   56 +
 tests/compat/test_integer.py                       |   53 +
 tests/compat/test_octets.py                        |  117 +
 tests/test_debug.py                                |   42 +
 {test => tests/type}/__init__.py                   |    0
 tests/type/__main__.py                             |   26 +
 tests/type/test_char.py                            |  175 +
 {test => tests}/type/test_constraint.py            |  167 +-
 tests/type/test_namedtype.py                       |  140 +
 tests/type/test_namedval.py                        |   58 +
 tests/type/test_opentype.py                        |  106 +
 {test => tests}/type/test_tag.py                   |   81 +-
 tests/type/test_univ.py                            | 1909 +++++++++++
 tests/type/test_useful.py                          |  143 +
 171 files changed, 18931 insertions(+), 9954 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.rst
similarity index 52%
rename from CHANGES.txt
rename to CHANGES.rst
index c5a870d..3c06812 100644
--- a/CHANGES.txt
+++ b/CHANGES.rst
@@ -1,9 +1,274 @@
+
+Revision 0.4.2, released 23-11-2017
+-----------------------------------
+
+- Fixed explicit tag splitting in chunked encoding mode at
+  OctetString and BitString encoders
+
+Revision 0.4.1, released 23-11-2017
+-----------------------------------
+
+- ANY DEFINED BY clause support implemented
+- Encoders refactored to take either a value (as ASN.1 object)
+  or a Python value plus ASN.1 schema
+- BitString decoder optimised for better performance when running on
+  constructed encoding
+- Constructed types' .getComponentBy*() methods accept the `default`
+  parameter to return instead if schema object is to be returned
+- Constructed types' .getComponentBy*() methods accept the `instantiate`
+  parameter to disable automatic inner component instantiation
+- The ASN.1 types' `__repr__` implementation reworked for better readability
+  at the cost of not being `eval`-compliant
+- Most ASN.1 types' `__str__` magic methods (except for OctetString and
+  character types) reworked to call `.prettyPrint()` rather than
+  `.prettyPrint` calling `__str__` as it was before. The intention is
+  to eventually deprecate `.prettyPrint()` in favor of `str()`.
+  The other related change is that `str()` of enumerations and boolean
+  types will return string label instead of number.
+- Fixed Choice.clear() to fully reset internal state of the object
+- Sphinx documentation rearranged, simplified and reworded
+- The `isValue` singleton is now the only way to indicate ASN.1 schema
+  as opposed to ASN.1 schema instance. The legacy `None` initializer
+  support has been removed.
+- Changed `Null` object initialization behaviour: previous default
+  value (`''`) is not set anymore. Thus `Null()` call produces a
+  ASN.1 schema object, while `Null('')` - value object.
+- Migrated all docs and references from SourceForge
+- Imports PEP8'ed
+- Fixed ASN.1 encoder not to omit empty substrate produced for inner
+  component if the inner component belongs to the simple class (as
+  opposed to constructed class)
+- Fixed CER/DER encoders to respect tagged CHOICE when ordering
+  SET components
+- Fixed ASN.1 types not to interfere with the Pickle protocol
+- Fixed Sequence/SequenceOf types decoding heuristics in schema-less
+  decoding mode
+
+Revision 0.3.7, released 04-10-2017
+-----------------------------------
+
+- Fixed ASN.1 time types pickling/deepcopy'ing
+
+Revision 0.3.6, released 21-09-2017
+-----------------------------------
+
+- End-of-octets encoding optimized at ASN.1 encoders
+- The __getitem__/__setitem__ behavior of Set/Sequence and SetOf/SequenceOf
+  objects aligned with the canonical Mapping and Sequence protocols in part
+- Fixed crash in ASN.1 encoder when encoding an explicitly tagged
+  component of a Sequence
+
+Revision 0.3.5, released 16-09-2017
+-----------------------------------
+
+- Codecs signatures unified and pass the options kwargs through the
+  call chain
+- Explicit tag encoding optimized to avoid unnecessary copying
+- End-of-octets sentinel encoding optimized
+- Refactored ASN.1 codecs properties to silently enforce proper
+  length and chunk size encoding modes
+- Fixed DER encoder to always produce primitive encoding
+- Fixed crash at SequenceOf native decoder
+- Fixed Real.prettyPrint() to fail gracefully on overflow
+- Fixed a couple of crashes when debug mode is enabled
+
+Revision 0.3.4, released 07-09-2017
+-----------------------------------
+
+- Fixed Native encoder to handle SEQUENCE/SET objects without
+  the componentType property
+- Added missing component-less SEQUENCE/SET objects dict duck-typing support
+- Fixed unnecessary duplicate tags detection at NamesType.tagMap
+- Fixed crash at SEQUENCE and SEQUENCE OF CER encoder when running
+  in schemaless mode
+- Fixed Character types instantiation from OctetString type -- double
+  unicode decoding may have scrambled the data
+
+Revision 0.3.3, released 27-08-2017
+-----------------------------------
+
+- Improved ASN.1 types instantiation performance
+- Improved BER/CER/DER decoder performance by not unconditionally casting
+  substrate into str/bytes.
+- Fixed exponential index size growth bug when building ambiguous
+  NamedTypes tree
+- Fixed constructed types decoding failure at BER codec if running
+  in schema-less mode
+- Fixed crash on prettyPrint'ing a SEQUENCE with no defined components
+- Fixed SetOf ordering at CER/DER encoder
+- Fixed crash on conditional binascii module import
+- Fix to TagSet hash value build
+
+Revision 0.3.2, released 04-08-2017
+-----------------------------------
+
+- Fixed SequenceOf/SetOf types initialization syntax to remain
+  backward compatible with pyasn1 0.2.*
+- Rectified thread safety issues by moving lazy, run-time computation
+  into object initializer.
+- Fixed .isValue property to return True for empty SetOf/SequenceOf
+  objects
+- Fixed GeneralizedTime/UTCTime CER/DER codecs to actually get invoked
+- Fixed DER/CER encoders handling optional SEQUENCE/SET fields containing
+  nested SEQUENCE/SET with optional fields.
+- Fixed crash in SequenceOf/SetOf pretty printing and decoding (in some
+  cases)
+- Fixed documentation markup issues.
+
+Revision 0.3.1, released 26-07-2017
+-----------------------------------
+
+- ASN.1 types __init__(), .clone() and .subtype() signatures
+  refactored into keyword arguments to simplify their signatures.
+- ASN.1 types initialization refactored to minimize the use of
+  relatively expensive isNoValue() call
+- Lazily pre-populate list of values of Sequence/Set/Choice types
+- NamedTypes comparison made more efficient
+- More efficient constraints computation and code clean up
+- The __getitem__() implementation of some ASN.1 types & tag object
+  refactored for better performance
+- BER/CER/DER value encoders refactored to produce either tuple of
+  bytes or octet-stream depending on what is more optimal
+- Reduced the frequency of expensive isinstance() calls
+- Tag-related classes optimized, refactored into properties and
+  documented.
+- The NamedValues implementation refactored to mimic Python dict, its use
+  in ASN.1 types refactored into properties and better documented.
+  WARNING: this change introduces a deviation from original API.
+- NamedType family of classes overhauled, optimized and documented.
+- The `componentType` attribute of constructed ASN.1 types turned
+  read-only on instances.
+- Sequence/Set DER/CER/DER decoder optimized to skip the case of
+  reordered components handling when not necessary.
+- Tags and constraints-related getter methods refactored into read-only
+  instance attributes.
+- The .hasValue() method refactored into .isValue property. All ASN.1
+  objects now support them, not just scalars.
+- The Real.{isInfinity, isPlusInfinity, isMinusInfinity} methods
+  refactored into properties and renamed into IsInf, IsPlusInf and isMinusInf
+- The end-of-octets type refactored to ensure it is a singleton. Codecs
+  changed to rely on that for better performance.
+- Codecs lookup made more efficient at BER/CER/DER decoder main loop by
+  assigning `typeId` to every ASN.1 type, not just ambiguous ones.
+- The .getComponent*() methods of constructed ASN.1 types changed
+  to lazily instantiate underlying type rather than return `None`.
+  This should simplify its API as initialization like `X[0][1] = 2` becomes
+  possible.
+  WARNING: this change introduces a deviation from the original API.
+- The .setComponent*() methods of SetOf/SequenceOf types changed not
+  to allow uninitialized "holes" inside the sequences of their components.
+  They now behave similarly to Python lists.
+  WARNING: this change introduces a deviation from the original API.
+- Default and optional components en/decoding of Constructed type
+  refactored towards better efficiency and more control.
+- OctetsString and Any decoder optimized to avoid creating ASN.1
+  objects for chunks of substrate. Instead they now join substrate
+  chunks together and create ASN.1 object from it just once.
+- The GeneralizedTime and UTCTime types now support to/from Python
+  datetime object conversion.
+- Unit tests added for the `compat` sub-package.
+- Fixed BitString named bits initialization bug.
+- Fixed non-functional tag cache (when running Python 2) at DER decoder.
+- Fixed chunked encoding restriction on DER encoder.
+- Fixed SET components ordering at DER encoder.
+- Fixed BIT STRING & OCTET STRING encoding to be always non-chunked (e.g.
+  primitive) at DER encoder
+- Fixed `compat.integer.from_bytes()` behaviour on empty input.
+
+Revision 0.2.3, released 25-02-2017
+-----------------------------------
+
+- Improved SEQUENCE/SET/CHOICE decoding performance by maintaining a single shared
+  NamedType object for all instances of SEQUENCE/SET object.
+- Improved INTEGER encoding/decoding by switching to Python's built-in
+  integer serialisation functions.
+- Improved BitString performance by rebasing it onto Python int type and leveraging
+  fast Integer serialisation functions.
+- BitString type usability improved in many ways: for example bitshifting and
+  numeric operation on BitString is now possible.
+- Minor ObjectIdentifier type performance optimization.
+- ASN.1 character types refactored to keep unicode contents internally
+  (rather than serialised octet stream) and duck-type it directly.
+- ASN.1 OctetString initialized from a Python object performs bytes()
+  on it when running on Python 3 (used to do str() which is probably
+  less logical).
+- Missing support for NoValue.__sizeof__ added.
+- Added checks to make sure SEQUENCE/SET components being assigned
+  match the prototypes.
+- Setter methods for constructed types consistently accept matchTags
+  and matchConstraints flags to control the strictness of inner
+  components compatibility verification. Previously, these checks
+  were tied to verifyConstraints flag, now they are all independent.
+- General documentation improvements here and there.
+- Fix to __reversed__() magic to make it returning an iterator.
+- Test suite simplified and unified.
+- The __all__ variable added to most of the Python modules.
+- The "test" directory renamed into "tests" not to collide with
+  the "test" module.
+
+Revision 0.2.2, released 07-02-2017
+-----------------------------------
+
+- FIX TO A SECURITY WEAKNESS: define length only decoders could have successfully
+  processed indefinite length serialisation.
+- FIX TO A SECURITY WEAKNESS: canonical decoders (CER/DER) may have successfully
+  consumed non-canonical variations of (otherwise valid) serialisation.
+- Broken Enumerated subtyping fixed.
+
+Revision 0.2.1, released 05-02-2017
+-----------------------------------
+
+- FIX TO A SECURITY WEAKNESS: BER decoder improperly cached long tags.
+- New "native" codec implemented to transform pyasn1 types to Python built-in types and back.
+- Switched to new-style classes.
+- Sphinx documentation added.
+- BitString improvements:
+
+  * simple string of binary digits is now supported as initializer
+  * default str() yields string of binary digits (used to yield str(tuple())
+  * binValue and hexValue initializers added
+  * .asNumbers(), .asOctets() and asInteger() representation added
+
+- Components of constructed ASN.1 types can now be populated with
+  uninitialized ASN.1 objects by assigning either noValue sentinel or
+  setupComponent() function return in addition to now-legacy None sentinel.
+  This should improve code readability.
+- NoValue class improved to become a singleton and catch more kinds
+  of access to it.
+- Compatibility wrappers str2octs() and oct2strs() fixed to run over
+  iso-8859-1 encoding.
+- Integer changed to emit Real instance if division produces a float.
+- True division operation now supported by Integer type.
+- The __contains__(), __reverse__() methods implemented for container types
+- Iterator protocol support implemented for all container types.
+  Warning, warning, warning: this change may potentially affect backward
+  compatibility when:
+
+  * user class overrides __getitem__() without overriding __iter__()
+  * when user code iterates over SEQUENCE object to get its components (now keys will be yielded)
+
+- Almost complete Python list and dict protocols added to SequenceOf/SetOf and
+  Sequence/Set respectively
+- Fix to divmod operation implementation in Integer type.
+- Fix to IntegerDecoder's precomputed value map on Python 3.
+- Fix to base ASN.1 types to run in "unicode_literals" mode.
+- Fix to composite constraints "+" operands ordering (AbstractConstraintSet.__radd__)
+- Fix to constraints merge in .subtype() -- on merge existing constraints are
+  expanded to accommodate new constraints, not the other way round. When existing
+  constraints are wrapped in ConstraintsIntersection composite, additional
+  constraints being added on subtyping effectively further narrow the set of
+  allowed values, which aligns well with the notion of subtyping.
+- Fix to NamedTypes methods to handle .getTagMap() returning None
+- Fix to Set/Sequence.setDefaultComponents() to return self
+- Copyright notice added to non-trivial source code files.
+- Author's email changed, copyright extended to 2017
+
 Revision 0.1.9, released 28-09-2015
 -----------------------------------
 
 - Wheel distribution format now supported.
 - Extensions added to text files, CVS attic flushed.
-- Fix to make uninitilaized pyasn1 objects failing properly on hash().
+- Fix to make uninitialized pyasn1 objects failing properly on hash().
 - Fix to ObjectIdentifier initialization from unicode string.
 - Fix to CER/DER Boolean decoder - fail on non single-octet payload.
 
@@ -14,7 +279,7 @@ Revision 0.1.8, released 22-06-2015
 - Explicit limit on ObjectIdentifier arc value size removed.
 - Unicode initializer support added to OctetString type and derivatives.
 - New prettyPrintType() abstract method implemented to base pyasn1 types
-  to facilitate encoding errors analisys.
+  to facilitate encoding errors analysis.
 - The __str__() method implemented to Tag, TagSet and TagMap classes to
   ease encoding errors troubleshooting.
   easing encoding errors
@@ -66,11 +331,12 @@ Revision 0.1.8, released 22-06-2015
 - Fix to broken REAL type decoding handling.
 - Fix to BitString and OctetString decoders dealing with constructed
   encoding -- it used to be possible to embed other types in substrate.
+- DER codec hardened not to tolerate indefinite length encoding/decoding.
 - Fix to end-of-octest sentinel handling:
-  * require strict two-zeros sentinel encoding
-  * recognize EOO sentinel only when explicitly requested by caller
+
+  + require strict two-zeros sentinel encoding
+  + recognize EOO sentinel only when explicitly requested by caller
     of the decoder via allowEoo=True parameter (warning: API change)
-- DER codec hardened not to tolerate indefinite length encoding/decoding.
 
 Revision 0.1.7
 --------------
@@ -172,14 +438,14 @@ Revision 0.1.1
   + switch to rich comparation
   + drop explicit long integer type use
   + map()/filter() replaced with list comprehension
-  + apply() replaced with */**args
+  + apply() replaced with \*/\*\*args
   + switched to use 'key' sort() callback function
   + support both __nonzero__() and __bool__() methods
   + modified not to use py3k-incompatible exception syntax
   + getslice() operator fully replaced with getitem()
   + dictionary operations made 2K/3K compatible
   + base type for encoding substrate and OctetString-based types
-    is now 'bytes' when running py3k and 'str' otherwise
+  is now 'bytes' when running py3k and 'str' otherwise
   + OctetString and derivatives now unicode compliant.
   + OctetString now supports two python-neutral getters: asOcts() & asInts()
   + print OctetString content in hex whenever it is not printable otherwise
@@ -198,7 +464,8 @@ Revision 0.0.13b
 - Objects of Constructed types now support __setitem__()
 - Set/Sequence objects can now be addressed by their field names (string index)
   and position (integer index).
-- Typo fix to ber.SetDecoder code that prevented guided decoding operation.
+- Typo fix to ber.SetDecoder code that prevented with schema decoding
+  operation.
 - Fix to explicitly tagged items decoding support.
 - Fix to OctetString.prettyPrint() to better handle non-printable content.
 - Fix to repr() workings of Choice objects.
@@ -216,12 +483,14 @@ Revision 0.0.13a
 - Fix to proper behaviour of PermittedAlphabetConstraint object.
 - Fix to improper Boolean substrate handling at CER/DER decoders.
 - Changes towards performance improvement:
+
   + all dict.has_key() & dict.get() invocations replaced with modern syntax
     (this breaks compatibility with Python 2.1 and older).
   + tag and tagset caches introduced to decoder
   + decoder code improved to prevent unnecessary pyasn1 objects creation
   + allow disabling components verification when setting components to
-    structured types, this is used by decoder whilst running in guided mode.
+    structured types, this is used by decoder whilst running with schema
+    mode.
   + BER decoder for integer values now looks up a small set of pre-computed
     substrate values to save on decoding.
   + a few pre-computed values configured to ObjectIdentifier BER encoder.
@@ -323,7 +592,7 @@ Revision 0.0.5a
 Revision 0.0.4a
 ---------------
 
-* Asn1ItemBase.prettyPrinter() -> *.prettyPrint()
+* Asn1ItemBase.prettyPrinter() -> \*.prettyPrint()
 
 Revision 0.0.3a
 ---------------
diff --git a/LICENSE.txt b/LICENSE.rst
similarity index 95%
rename from LICENSE.txt
rename to LICENSE.rst
index 53158c7..02b45c4 100644
--- a/LICENSE.txt
+++ b/LICENSE.rst
@@ -1,4 +1,4 @@
-Copyright (c) 2005-2015, Ilya Etingof <ilya at glas.net>
+Copyright (c) 2005-2017, Ilya Etingof <etingof at gmail.com>
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/MANIFEST.in b/MANIFEST.in
index 940c86e..c605b0e 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,5 @@
-include *.txt
-recursive-include test *.py
-recursive-include doc *.html
+include *.rst *.md
+recursive-include tests *.py
+recursive-include docs Makefile *.rst *.svg conf.py
+prune docs/build
+prune docs/source/.templates
diff --git a/PKG-INFO b/PKG-INFO
index 58794be..3be9753 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,26 +1,33 @@
 Metadata-Version: 1.1
 Name: pyasn1
-Version: 0.1.9
+Version: 0.4.2
 Summary: ASN.1 types and codecs
-Home-page: http://sourceforge.net/projects/pyasn1/
-Author: Ilya Etingof <ilya at glas.net>
-Author-email: ilya at glas.net
+Home-page: https://github.com/etingof/pyasn1
+Author: Ilya Etingof <etingof at gmail.com>
+Author-email: etingof at gmail.com
 License: BSD
-Description: A pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208).
+Description: Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208)
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Education
 Classifier: Intended Audience :: Information Technology
-Classifier: Intended Audience :: Science/Research
 Classifier: Intended Audience :: System Administrators
 Classifier: Intended Audience :: Telecommunications Industry
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Natural Language :: English
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.4
+Classifier: Programming Language :: Python :: 2.5
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.2
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
 Classifier: Topic :: Communications
-Classifier: Topic :: Security :: Cryptography
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..90ab094
--- /dev/null
+++ b/README.md
@@ -0,0 +1,184 @@
+
+ASN.1 library for Python
+------------------------
+[![PyPI](https://img.shields.io/pypi/v/pyasn1.svg?maxAge=2592000)](https://pypi.python.org/pypi/pyasn1)
+[![Python Versions](https://img.shields.io/pypi/pyversions/pyasn1.svg)](https://pypi.python.org/pypi/pyasn1/)
+[![Build status](https://travis-ci.org/etingof/pyasn1.svg?branch=master)](https://secure.travis-ci.org/etingof/pyasn1)
+[![Coverage Status](https://img.shields.io/codecov/c/github/etingof/pyasn1.svg)](https://codecov.io/github/etingof/pyasn1)
+[![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/etingof/pyasn1/master/LICENSE.txt)
+
+This is a free and open source implementation of ASN.1 types and codecs
+as a Python package. It has been first written to support particular
+protocol (SNMP) but then generalized to be suitable for a wide range
+of protocols based on
+[ASN.1 specification](https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.208-198811-W!!PDF-E&type=items).
+
+Features
+--------
+
+* Generic implementation of ASN.1 types (X.208)
+* Standards compliant BER/CER/DER codecs
+* Dumps/loads ASN.1 structures from Python types
+* 100% Python, works with Python 2.4 up to Python 3.6
+* MT-safe
+* Contributed ASN.1 compiler [Asn1ate](https://github.com/kimgr/asn1ate)
+
+Why using pyasn1
+----------------
+
+ASN.1 solves the data serialisation problem. This solution was
+designed long ago by the wise Ancients. Back then, they did not
+have the luxury of wasting bits. That is why ASN.1 is designed
+to serialise data structures of unbounded complexity into
+something compact and efficient when it comes to processing
+the data.
+
+That probably explains why many network protocols and file formats
+still rely on the 30+ years old technology. Including a number of
+high-profile Internet protocols and file formats.
+
+Quite a number of books cover the topic of ASN.1. 
+[Communication between heterogeneous systems](http://www.oss.com/asn1/dubuisson.html)
+by Olivier Dubuisson is one of those high quality books freely 
+available on the Internet.
+
+The pyasn1 package is designed to help Python programmers tackling
+network protocols and file formats at the comfort of their Python
+prompt. The tool struggles to capture all aspects of a rather
+complicated ASN.1 system and to represent it on the Python terms.
+
+How to use pyasn1
+-----------------
+
+With pyasn1 you can build Python objects from ASN.1 data structures.
+For example, the following ASN.1 data structure:
+
+```bash
+Record ::= SEQUENCE {
+  id        INTEGER,
+  room  [0] INTEGER OPTIONAL,
+  house [1] INTEGER DEFAULT 0
+}
+```
+
+Could be expressed in pyasn1 like this:
+
+```python
+class Record(Sequence):
+    componentType = NamedTypes(
+        NamedType('id', Integer()),
+        OptionalNamedType(
+            'room', Integer().subtype(
+                implicitTag=Tag(tagClassContext, tagFormatSimple, 0)
+            )
+        ),
+        DefaultedNamedType(
+            'house', Integer(0).subtype(
+                implicitTag=Tag(tagClassContext, tagFormatSimple, 1)
+            )
+        )
+    )
+```
+
+It is in the spirit of ASN.1 to take abstract data description 
+and turn it into a programming language specific form.
+Once you have your ASN.1 data structure expressed in Python, you
+can use it along the lines of similar Python type (e.g. ASN.1
+`SET` is similar to Python `dict`, `SET OF` to `list`):
+
+```python
+>>> record = Record()
+>>> record['id'] = 123
+>>> record['room'] = 321
+>>> str(record)
+Record:
+ id=123
+ room=321
+>>>
+```
+
+Part of the power of ASN.1 comes from its serialisation features. You
+can serialise your data structure and send it over the network.
+
+```python
+>>> from pyasn1.codec.der.encoder import encode
+>>> substrate = encode(record)
+>>> hexdump(substrate)
+00000: 30 07 02 01 7B 80 02 01 41
+```
+
+Conversely, you can turn serialised ASN.1 content, as received from
+network or read from a file, into a Python object which you can
+introspect, modify, encode and send back.
+
+```python
+>>> from pyasn1.codec.der.decoder import decode
+>>> received_record, rest_of_substrate = decode(substrate, asn1Spec=Record())
+>>>
+>>> for field in received_record:
+>>>    print('{} is {}'.format(field, received_record[field]))
+id is 123
+room is 321
+house is 0
+>>>
+>>> record == received_record
+True
+>>> received_record.update(room=123)
+>>> substrate = encode(received_record)
+>>> hexdump(substrate)
+00000: 30 06 02 01 7B 80 01 7B
+```
+
+The pyasn1 classes struggle to emulate their Python prototypes (e.g. int,
+list, dict etc.). But ASN.1 types exhibit more complicated behaviour.
+To make life easier for a Pythonista, they can turn their pyasn1
+classes into Python built-ins:
+
+```python
+>>> from pyasn1.codec.native.encoder import encode
+>>> encode(record)
+{'id': 123, 'room': 321, 'house': 0}
+```
+
+Or vice-versa -- you can initialize an ASN.1 structure from a tree of
+Python objects:
+
+```python
+>>> from pyasn1.codec.native.decoder import decode
+>>> record = decode({'id': 123, 'room': 321, 'house': 0}, asn1Spec=Record())
+>>> str(record)
+Record:
+ id=123
+ room=321
+>>>
+```
+
+With ASN.1 design, serialisation codecs are decoupled from data objects,
+so you could turn every single ASN.1 object into many different 
+serialised forms. As of this moment, pyasn1 supports BER, DER, CER and
+Python built-ins codecs. The extremely compact PER encoding is expected
+to be introduced in the upcoming pyasn1 release.
+
+More information on pyasn1 APIs can be found in the
+[documentation](http://snmplabs.com/pyasn1/),
+compiled ASN.1 modules for different protocols and file formats
+could be found in the pyasn1-modules 
+[repo](https://github.com/etingof/pyasn1-modules).
+
+How to get pyasn1
+-----------------
+
+The pyasn1 package is distributed under terms and conditions of 2-clause
+BSD [license](http://snmplabs.com/pyasn1/license.html). Source code is freely
+available as a GitHub [repo](https://github.com/etingof/pyasn1).
+
+You could `pip install pyasn1` or download it from [PyPI](https://pypi.python.org/pypi/pyasn1).
+
+If something does not work as expected, 
+[open an issue](https://github.com/etingof/pyasn1/issues) at GitHub or
+post your question [on Stack Overflow](http://stackoverflow.com/questions/ask)
+or try browsing pyasn1 
+[mailing list archives](https://sourceforge.net/p/pyasn1/mailman/pyasn1-users/).
+
+Copyright (c) 2005-2017, [Ilya Etingof](mailto:etingof at gmail.com).
+All rights reserved.
diff --git a/README.txt b/README.txt
deleted file mode 100644
index 6727728..0000000
--- a/README.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-
-ASN.1 library for Python
-------------------------
-
-This is an implementation of ASN.1 types and codecs in Python programming
-language. It has been first written to support particular protocol (SNMP)
-but then generalized to be suitable for a wide range of protocols
-based on ASN.1 specification.
-
-FEATURES
---------
-
-* Generic implementation of ASN.1 types (X.208)
-* Fully standard compliant BER/CER/DER codecs
-* 100% Python, works with Python 2.4 up to Python 3.4
-* MT-safe
-
-MISFEATURES
------------
-
-* No ASN.1 compiler (by-hand ASN.1 spec compilation into Python code required)
-* Codecs are not restartable
-
-INSTALLATION
-------------
-
-The pyasn1 package uses setuptools/distutils for installation. Thus do
-either:
-
-$ easy_install pyasn1
-
-or
-
-$ tar zxf pyasn1-0.1.8.tar.gz
-$ cd pyasn1-0.1.8
-$ python setup.py install
-$ python setup.py test    # run unit tests (optional)
-
-OPERATION
----------
-
-Perhaps a typical use would involve [by-hand] compilation of your ASN.1
-specification into pyasn1-backed Python code at your application.
-
-For more information on pyasn1 APIs, please, refer to the 
-doc/pyasn1-tutorial.html file in the distribution.
-
-Also refer to example modules. Take a look at pyasn1-modules package -- maybe
-it already holds something useful to you.
-
-AVAILABILITY
-------------
-
-The pyasn1 package is distributed under terms and conditions of BSD-style
-license. See LICENSE file in the distribution. Source code is freely
-available from:
-
-http://pyasn1.sf.net
-
-
-FEEDBACK
---------
-
-Please, send your comments and fixes to mailing lists at project web site.
-
-=-=-=
-mailto: ilya at glas.net
diff --git a/THANKS.txt b/THANKS.txt
deleted file mode 100644
index 890ff72..0000000
--- a/THANKS.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Denis S. Otkidach
-Gregory Golberg
-Bud P. Bruegger
-Jacek Konieczny
-Tanya Tereschenko
-Matěj Cepl
-Alex Gaynor
-Geoffrey Thomas
-Daniel Bratell
-Kim Gräsman
diff --git a/TODO.rst b/TODO.rst
new file mode 100644
index 0000000..5c79ee7
--- /dev/null
+++ b/TODO.rst
@@ -0,0 +1,92 @@
+
+Things to be done
+=================
+
+Big things to tackle, anyone interested is welcome to fork pyasn1, work on
+it and come up with a PR!
+
+New codecs
+----------
+
+* PER
+* OER
+* XER
+* LWER
+* JSON (alinged with existing experimental schemas)
+
+Lazy codecs
+-----------
+
+Implement a thin layer over base types to cache pieces
+of substrate being decoded till the very moment of ASN.1
+object access in the parse tree.
+
+Codecs generator interface
+--------------------------
+
+For indefinite length or chunked encoding mode, make codecs
+iterable producing/consuming substrate/objects.
+
+ASN.1 schema compiler
+---------------------
+
+Ideally, the compiler should parse modern schema files and be
+designed to emit code for arbitrary languages (including SQL).
+
+Base types
+----------
+
+Implement X.680 constructs, including information schema.
+
+Examples
+--------
+
+Add examples, including advanced/obscure use cases.
+
+Documentation
+-------------
+
+Document more API, add notes and example snippets.
+
+More fresh modules
+------------------
+
+Compile and ship more Pythonized ASN.1 modules for
+various ASN.1-based protocols (e.g. Kerberos etc).
+Refresh outdated modules in pyasn1-packages.
+
+Minor, housekeeping things
+--------------------------
+
+* more PEP8'ing at places
+* consider simplifying repr(), otherwise it tend to be too hard to grasp
+* Specialize ASN.1 character and useful types
+
+* ber.decoder:
+
+    * suspend codec on underrun error ?
+    * present subtypes ?
+    * component presence check wont work at innertypeconst
+    * type vs value, defaultValue
+
+* ber.encoder:
+
+    * Asn1Item.clone() / shallowcopy issue
+    * large length encoder?
+    * lookup type by tag first to allow custom codecs for non-base types
+
+* type.useful:
+
+    * may need to implement prettyIn/Out
+
+* type.char:
+
+    * may need to implement constraints
+
+* type.namedtypes
+
+    * type vs tagset name convention
+
+* how untagged TagSet should be initialized?
+
+* type and codecs for Real needs refactoring
diff --git a/TODO.txt b/TODO.txt
deleted file mode 100644
index 0ee211c..0000000
--- a/TODO.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-* Specialize ASN.1 character and useful types
-* Come up with simpler API for deeply nested constructed objects
-  addressing
-
-ber.decoder:
-* suspend codec on underrun error ?
-* class-static components map (in simple type classes)
... 30817 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyasn1.git



More information about the Python-modules-commits mailing list