Preferable way is to :ref:`download <download>` tarball with the
signature from `official website <http://pyderasn.cypherpunks.ru/>`__::
- $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-7.6.tar.xz
- $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-7.6.tar.xz.sig
- $ gpg --verify pyderasn-7.6.tar.xz.sig pyderasn-7.6.tar.xz
- $ xz --decompress --stdout pyderasn-7.6.tar.xz | tar xf -
- $ cd pyderasn-7.6
+ $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-7.7.tar.xz
+ $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-7.7.tar.xz.sig
+ $ gpg --verify pyderasn-7.7.tar.xz.sig pyderasn-7.7.tar.xz
+ $ xz --decompress --stdout pyderasn-7.7.tar.xz | tar xf -
+ $ cd pyderasn-7.7
$ python setup.py install
# or copy pyderasn.py (+six.py, possibly termcolor.py) to your PYTHONPATH
You could use pip (**no** OpenPGP authentication is performed!) with PyPI::
$ cat > requirements.txt <<EOF
- pyderasn==7.6 --hash=sha256:TO-BE-FILLED
+ pyderasn==7.7 --hash=sha256:TO-BE-FILLED
six==1.14.0 --hash=sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a
EOF
$ pip install --requirement requirements.txt
News
====
+.. _release7.7:
+
+7.7
+---
+* Strictly check that tag's long encoded form does not contain leading zero
+ (X.690 8.1.2.4.2 (c))
+
.. _release7.6:
7.6
def colored(what, *args, **kwargs):
return what
-__version__ = "7.6"
+__version__ = "7.7"
__all__ = (
"agg_octet_string",
raise DecodeError("unfinished tag")
if indexbytes(data, i) & 0x80 == 0:
break
+ if i > 1 and indexbytes(data, 1) & 0x7F == 0:
+ raise DecodeError("leading zero byte in tag value")
i += 1
return data[:i], i, data[i:]
with self.assertRaises(DecodeError):
len_decode(octets)
+ @given(tag_classes, tag_forms, integers(min_value=31))
+ def test_leading_zero_byte(self, klass, form, num):
+ raw = tag_encode(klass=klass, form=form, num=num)
+ raw = b"".join((raw[:1], b"\x80", raw[1:]))
+ with assertRaisesRegex(self, DecodeError, "leading zero byte"):
+ tag_strip(raw)
+
class TestLenCoder(TestCase):
@settings(max_examples=LONG_TEST_MAX_EXAMPLES)