Skip to content

Upgrading pyasn1 0.0 to 0.1

Breaking0.0.13 → 0.1.9Breaking4Security1New19Changed14Fixed34Other10

BreakingUpgrade verdict

4 breaking changes and a security fix.

  • Decoders now require the strict two-zero end-of-octets marker and only accept an end-of-octets sentinel if the caller explicitly asks for it with allowEoo=True.
  • Custom decoders that override this method must now return what is left after the decoded item rather than what is left inside it.
  • Code reading the old MajorVersionId attribute must switch to __version__.
  • Creating an OctetString from a hex or binary string now works differently, so existing code that does this may need updating.
Top 4 of 5 that need code or config changes
Breaking4
Fixes end-of-octest sentinel handling: requires strict two-zeros sentinel and only recognizes EOO when allowEoo=True is passed.
allowEoo
Changes AbstractDecoder.valueDecoder overrides to return the substrate remaining after the item, not the unprocessed substrate within it.
AbstractDecoder.valueDecoder
Replaces obsolete __init__.MajorVersionId with __init__.__version__, now kept in sync with distutils.
MajorVersionId__version__
Reworks the hex/bin string initializer for OctetString in a backward-incompatible manner.
OctetString
Security1
Hardens the DER codec to reject indefinite length encoding and decoding.
DER