diff -Nru asn1crypto-1.3.0/asn1crypto/core.py asn1crypto-1.4.0/asn1crypto/core.py --- asn1crypto-1.3.0/asn1crypto/core.py 2019-10-01 04:41:52.000000000 +0000 +++ asn1crypto-1.4.0/asn1crypto/core.py 2020-07-25 14:43:08.000000000 +0000 @@ -3104,6 +3104,21 @@ first = part continue elif index == 1: + if first > 2: + raise ValueError(unwrap( + ''' + First arc must be one of 0, 1 or 2, not %s + ''', + repr(first) + )) + elif first < 2 and part >= 40: + raise ValueError(unwrap( + ''' + Second arc must be less than 40 if first arc is 0 or + 1, not %s + ''', + repr(part) + )) part = (first * 40) + part encoded_part = chr_cls(0x7F & part) @@ -3145,8 +3160,15 @@ # Last byte in subidentifier has the eighth bit set to 0 if byte & 0x80 == 0: if len(output) == 0: - output.append(str_cls(part // 40)) - output.append(str_cls(part % 40)) + if part >= 80: + output.append(str_cls(2)) + output.append(str_cls(part - 80)) + elif part >= 40: + output.append(str_cls(1)) + output.append(str_cls(part - 40)) + else: + output.append(str_cls(0)) + output.append(str_cls(part)) else: output.append(str_cls(part)) part = 0 diff -Nru asn1crypto-1.3.0/asn1crypto/keys.py asn1crypto-1.4.0/asn1crypto/keys.py --- asn1crypto-1.3.0/asn1crypto/keys.py 2019-11-22 16:28:23.000000000 +0000 +++ asn1crypto-1.4.0/asn1crypto/keys.py 2020-07-25 14:49:30.000000000 +0000 @@ -1216,7 +1216,7 @@ if self._bit_size is None: if self.algorithm == 'ec': - self._bit_size = ((len(self['public_key'].native) - 1) / 2) * 8 + self._bit_size = int(((len(self['public_key'].native) - 1) / 2) * 8) else: if self.algorithm == 'rsa': prime = self['public_key'].parsed['modulus'].native diff -Nru asn1crypto-1.3.0/asn1crypto/version.py asn1crypto-1.4.0/asn1crypto/version.py --- asn1crypto-1.3.0/asn1crypto/version.py 2020-01-04 14:00:52.000000000 +0000 +++ asn1crypto-1.4.0/asn1crypto/version.py 2020-07-28 12:28:34.000000000 +0000 @@ -2,5 +2,5 @@ from __future__ import unicode_literals, division, absolute_import, print_function -__version__ = '1.3.0' -__version_info__ = (1, 3, 0) +__version__ = '1.4.0' +__version_info__ = (1, 4, 0) diff -Nru asn1crypto-1.3.0/asn1crypto/x509.py asn1crypto-1.4.0/asn1crypto/x509.py --- asn1crypto-1.3.0/asn1crypto/x509.py 2019-11-22 16:28:23.000000000 +0000 +++ asn1crypto-1.4.0/asn1crypto/x509.py 2020-05-21 15:06:44.000000000 +0000 @@ -1136,7 +1136,7 @@ """ if isinstance(value, list): - return', '.join( + return ', '.join( reversed([self._recursive_humanize(sub_value) for sub_value in value]) ) return value.native diff -Nru asn1crypto-1.3.0/asn1crypto.egg-info/PKG-INFO asn1crypto-1.4.0/asn1crypto.egg-info/PKG-INFO --- asn1crypto-1.3.0/asn1crypto.egg-info/PKG-INFO 2020-01-04 14:21:06.000000000 +0000 +++ asn1crypto-1.4.0/asn1crypto.egg-info/PKG-INFO 2020-07-28 14:18:11.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: asn1crypto -Version: 1.3.0 +Version: 1.4.0 Summary: Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP Home-page: https://github.com/wbond/asn1crypto Author: wbond @@ -27,7 +27,6 @@ [![Travis CI](https://api.travis-ci.org/wbond/asn1crypto.svg?branch=master)](https://travis-ci.org/wbond/asn1crypto) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/wbond/asn1crypto?branch=master&svg=true)](https://ci.appveyor.com/project/wbond/asn1crypto) [![CircleCI](https://circleci.com/gh/wbond/asn1crypto.svg?style=shield)](https://circleci.com/gh/wbond/asn1crypto) - [![Codecov](https://codecov.io/gh/wbond/asn1crypto/branch/master/graph/badge.svg)](https://codecov.io/gh/wbond/asn1crypto) [![PyPI](https://img.shields.io/pypi/v/asn1crypto.svg)](https://pypi.org/project/asn1crypto/) ## Features @@ -120,7 +119,7 @@ ## Current Release - 1.3.0 - [changelog](changelog.md) + 1.4.0 - [changelog](changelog.md) ## Dependencies @@ -164,10 +163,12 @@ ## Continuous Integration - - [Windows](https://ci.appveyor.com/project/wbond/asn1crypto/history) via AppVeyor - - [OS X](https://circleci.com/gh/wbond/asn1crypto) via CircleCI - - [Linux](https://travis-ci.org/wbond/asn1crypto/builds) via Travis CI - - [Test Coverage](https://codecov.io/gh/wbond/asn1crypto/commits) via Codecov + Various combinations of platforms and versions of Python are tested via: + + - [AppVeyor](https://ci.appveyor.com/project/wbond/asn1crypto/history) + - [CircleCI](https://circleci.com/gh/wbond/asn1crypto) + - [GitHub Actions](https://github.com/wbond/asn1crypto/actions) + - [Travis CI](https://travis-ci.org/wbond/asn1crypto/builds) ## Testing diff -Nru asn1crypto-1.3.0/changelog.md asn1crypto-1.4.0/changelog.md --- asn1crypto-1.3.0/changelog.md 2020-01-04 14:00:42.000000000 +0000 +++ asn1crypto-1.4.0/changelog.md 2020-07-28 12:30:43.000000000 +0000 @@ -1,5 +1,16 @@ # changelog +## 1.4.0 + + - `core.ObjectIdentifier` and all derived classes now obey X.660 ยง7.6 and + thus restrict the first arc to 0 to 2, and the second arc to less than + 40 if the first arc is 0 or 1. This also fixes parsing of OIDs where the + first arc is 2 and the second arc is greater than 39. + - Fixed `keys.PublicKeyInfo.bit_size` to return an int rather than a float + on Python 3 when working with elliptic curve keys + - Fixed the `asn1crypto-tests` sdist on PyPi to work properly to generate a + .whl + ## 1.3.0 - Added `encrypt_key_pref` (`1.2.840.113549.1.9.16.2.11`) to diff -Nru asn1crypto-1.3.0/debian/changelog asn1crypto-1.4.0/debian/changelog --- asn1crypto-1.3.0/debian/changelog 2020-07-15 13:40:07.000000000 +0000 +++ asn1crypto-1.4.0/debian/changelog 2020-08-03 10:04:29.000000000 +0000 @@ -1,3 +1,9 @@ +asn1crypto (1.4.0-1) unstable; urgency=medium + + * New upstream release. + + -- Tristan Seligmann Mon, 03 Aug 2020 12:04:29 +0200 + asn1crypto (1.3.0-1) unstable; urgency=low [ Debian Janitor ] diff -Nru asn1crypto-1.3.0/PKG-INFO asn1crypto-1.4.0/PKG-INFO --- asn1crypto-1.3.0/PKG-INFO 2020-01-04 14:21:06.845753000 +0000 +++ asn1crypto-1.4.0/PKG-INFO 2020-07-28 14:18:11.806995200 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: asn1crypto -Version: 1.3.0 +Version: 1.4.0 Summary: Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP Home-page: https://github.com/wbond/asn1crypto Author: wbond @@ -27,7 +27,6 @@ [![Travis CI](https://api.travis-ci.org/wbond/asn1crypto.svg?branch=master)](https://travis-ci.org/wbond/asn1crypto) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/wbond/asn1crypto?branch=master&svg=true)](https://ci.appveyor.com/project/wbond/asn1crypto) [![CircleCI](https://circleci.com/gh/wbond/asn1crypto.svg?style=shield)](https://circleci.com/gh/wbond/asn1crypto) - [![Codecov](https://codecov.io/gh/wbond/asn1crypto/branch/master/graph/badge.svg)](https://codecov.io/gh/wbond/asn1crypto) [![PyPI](https://img.shields.io/pypi/v/asn1crypto.svg)](https://pypi.org/project/asn1crypto/) ## Features @@ -120,7 +119,7 @@ ## Current Release - 1.3.0 - [changelog](changelog.md) + 1.4.0 - [changelog](changelog.md) ## Dependencies @@ -164,10 +163,12 @@ ## Continuous Integration - - [Windows](https://ci.appveyor.com/project/wbond/asn1crypto/history) via AppVeyor - - [OS X](https://circleci.com/gh/wbond/asn1crypto) via CircleCI - - [Linux](https://travis-ci.org/wbond/asn1crypto/builds) via Travis CI - - [Test Coverage](https://codecov.io/gh/wbond/asn1crypto/commits) via Codecov + Various combinations of platforms and versions of Python are tested via: + + - [AppVeyor](https://ci.appveyor.com/project/wbond/asn1crypto/history) + - [CircleCI](https://circleci.com/gh/wbond/asn1crypto) + - [GitHub Actions](https://github.com/wbond/asn1crypto/actions) + - [Travis CI](https://travis-ci.org/wbond/asn1crypto/builds) ## Testing diff -Nru asn1crypto-1.3.0/readme.md asn1crypto-1.4.0/readme.md --- asn1crypto-1.3.0/readme.md 2020-01-04 14:01:00.000000000 +0000 +++ asn1crypto-1.4.0/readme.md 2020-07-28 12:27:38.000000000 +0000 @@ -19,7 +19,6 @@ [![Travis CI](https://api.travis-ci.org/wbond/asn1crypto.svg?branch=master)](https://travis-ci.org/wbond/asn1crypto) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/wbond/asn1crypto?branch=master&svg=true)](https://ci.appveyor.com/project/wbond/asn1crypto) [![CircleCI](https://circleci.com/gh/wbond/asn1crypto.svg?style=shield)](https://circleci.com/gh/wbond/asn1crypto) -[![Codecov](https://codecov.io/gh/wbond/asn1crypto/branch/master/graph/badge.svg)](https://codecov.io/gh/wbond/asn1crypto) [![PyPI](https://img.shields.io/pypi/v/asn1crypto.svg)](https://pypi.org/project/asn1crypto/) ## Features @@ -112,7 +111,7 @@ ## Current Release -1.3.0 - [changelog](changelog.md) +1.4.0 - [changelog](changelog.md) ## Dependencies @@ -156,10 +155,12 @@ ## Continuous Integration - - [Windows](https://ci.appveyor.com/project/wbond/asn1crypto/history) via AppVeyor - - [OS X](https://circleci.com/gh/wbond/asn1crypto) via CircleCI - - [Linux](https://travis-ci.org/wbond/asn1crypto/builds) via Travis CI - - [Test Coverage](https://codecov.io/gh/wbond/asn1crypto/commits) via Codecov +Various combinations of platforms and versions of Python are tested via: + + - [AppVeyor](https://ci.appveyor.com/project/wbond/asn1crypto/history) + - [CircleCI](https://circleci.com/gh/wbond/asn1crypto) + - [GitHub Actions](https://github.com/wbond/asn1crypto/actions) + - [Travis CI](https://travis-ci.org/wbond/asn1crypto/builds) ## Testing diff -Nru asn1crypto-1.3.0/setup.py asn1crypto-1.4.0/setup.py --- asn1crypto-1.3.0/setup.py 2020-01-04 14:00:52.000000000 +0000 +++ asn1crypto-1.4.0/setup.py 2020-07-28 12:28:34.000000000 +0000 @@ -10,7 +10,7 @@ PACKAGE_NAME = 'asn1crypto' -PACKAGE_VERSION = '1.3.0' +PACKAGE_VERSION = '1.4.0' PACKAGE_ROOT = os.path.dirname(os.path.abspath(__file__))