Hello community,

here is the log from the commit of package python-asn1crypto for 
openSUSE:Factory checked in at 2020-08-25 12:38:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-asn1crypto (Old)
 and      /work/SRC/openSUSE:Factory/.python-asn1crypto.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-asn1crypto"

Tue Aug 25 12:38:53 2020 rev:9 rq:828177 version:1.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-asn1crypto/python-asn1crypto.changes      
2020-01-20 22:50:19.927225509 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-asn1crypto.new.3399/python-asn1crypto.changes
    2020-08-25 12:39:04.597417966 +0200
@@ -1,0 +2,12 @@
+Thu Aug 20 12:41:38 UTC 2020 - Ondřej Súkup <[email protected]>
+
+- update to 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
+
+-------------------------------------------------------------------

Old:
----
  1.3.0.tar.gz

New:
----
  1.4.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-asn1crypto.spec ++++++
--- /var/tmp/diff_new_pack.1WyUf1/_old  2020-08-25 12:39:05.745418183 +0200
+++ /var/tmp/diff_new_pack.1WyUf1/_new  2020-08-25 12:39:05.749418183 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-asn1crypto
-Version:        1.3.0
+Version:        1.4.0
 Release:        0
 Summary:        ASN.1 parser and serializer for Python
 License:        MIT

++++++ 1.3.0.tar.gz -> 1.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/.circleci/config.yml 
new/asn1crypto-1.4.0/.circleci/config.yml
--- old/asn1crypto-1.3.0/.circleci/config.yml   2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/.circleci/config.yml   2020-07-28 14:31:23.000000000 
+0200
@@ -14,16 +14,13 @@
       xcode: 10.3.0
     steps:
       - checkout
-      - restore_cache:
-          keys:
-            - homebrew
-      - run: brew install pypy
-      - save_cache:
-          key: homebrew
-          paths:
-            - /usr/local/Homebrew
-      - run: pypy run.py deps
-      - run: pypy run.py ci
+      - run: curl --location -O 
https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.3.1-osx64.tar.bz2
+      - run: tar xvf pypy2.7-v7.3.1-osx64.tar.bz2
+      - run: mv pypy2.7-v7.3.1-osx64 pypy
+      - run: xattr -rc pypy
+      - run: ./pypy/bin/pypy -m ensurepip
+      - run: ./pypy/bin/pypy run.py deps
+      - run: ./pypy/bin/pypy run.py ci
 workflows:
   version: 2
   python-26:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/.github/workflows/ci.yml 
new/asn1crypto-1.4.0/.github/workflows/ci.yml
--- old/asn1crypto-1.3.0/.github/workflows/ci.yml       2020-01-04 
15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/.github/workflows/ci.yml       2020-07-28 
14:31:23.000000000 +0200
@@ -1,5 +1,5 @@
 name: CI
-on: [push]
+on: [push, pull_request]
 
 jobs:
   build:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/.travis.yml 
new/asn1crypto-1.4.0/.travis.yml
--- old/asn1crypto-1.3.0/.travis.yml    2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/.travis.yml    2020-07-28 14:31:23.000000000 +0200
@@ -31,6 +31,11 @@
       language: python
       python: "3.7"
     - os: linux
+      arch: ppc64le
+      dist: bionic
+      language: python
+      python: "3.7"
+    - os: linux
       dist: xenial
       language: python
       python: "pypy"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/asn1crypto/core.py 
new/asn1crypto-1.4.0/asn1crypto/core.py
--- old/asn1crypto-1.3.0/asn1crypto/core.py     2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/asn1crypto/core.py     2020-07-28 14:31:23.000000000 
+0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/asn1crypto/keys.py 
new/asn1crypto-1.4.0/asn1crypto/keys.py
--- old/asn1crypto-1.3.0/asn1crypto/keys.py     2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/asn1crypto/keys.py     2020-07-28 14:31:23.000000000 
+0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/asn1crypto/version.py 
new/asn1crypto-1.4.0/asn1crypto/version.py
--- old/asn1crypto-1.3.0/asn1crypto/version.py  2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/asn1crypto/version.py  2020-07-28 14:31:23.000000000 
+0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/asn1crypto/x509.py 
new/asn1crypto-1.4.0/asn1crypto/x509.py
--- old/asn1crypto-1.3.0/asn1crypto/x509.py     2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/asn1crypto/x509.py     2020-07-28 14:31:23.000000000 
+0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/changelog.md 
new/asn1crypto-1.4.0/changelog.md
--- old/asn1crypto-1.3.0/changelog.md   2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/changelog.md   2020-07-28 14:31:23.000000000 +0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/codecov.json 
new/asn1crypto-1.4.0/codecov.json
--- old/asn1crypto-1.3.0/codecov.json   2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/codecov.json   2020-07-28 14:31:23.000000000 +0200
@@ -1,4 +1,5 @@
 {
   "slug": "wbond/asn1crypto",
-  "token": "98876f5e-6517-4def-85ce-c6e508eee35a"
+  "token": "98876f5e-6517-4def-85ce-c6e508eee35a",
+  "disabled": true
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/dev/deps.py 
new/asn1crypto-1.4.0/dev/deps.py
--- old/asn1crypto-1.3.0/dev/deps.py    2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/dev/deps.py    2020-07-28 14:31:23.000000000 +0200
@@ -96,7 +96,78 @@
         A tuple of integers
     """
 
-    return tuple(map(int, version_string.split('.')))
+    match = re.search(
+        r'(\d+(?:\.\d+)*)'
+        r'([-._]?(?:alpha|a|beta|b|preview|pre|c|rc)\.?\d*)?'
+        r'(-\d+|(?:[-._]?(?:rev|r|post)\.?\d*))?'
+        r'([-._]?dev\.?\d*)?',
+        version_string
+    )
+    if not match:
+        return tuple()
+
+    nums = tuple(map(int, match.group(1).split('.')))
+
+    pre = match.group(2)
+    if pre:
+        pre = pre.replace('alpha', 'a')
+        pre = pre.replace('beta', 'b')
+        pre = pre.replace('preview', 'rc')
+        pre = pre.replace('pre', 'rc')
+        pre = re.sub(r'(?<!r)c', 'rc', pre)
+        pre = pre.lstrip('._-')
+        pre_dig_match = re.search(r'\d+', pre)
+        if pre_dig_match:
+            pre_dig = int(pre_dig_match.group(0))
+        else:
+            pre_dig = 0
+        pre = pre.rstrip('0123456789')
+
+        pre_num = {
+            'a': -3,
+            'b': -2,
+            'rc': -1,
+        }[pre]
+
+        pre_tup = (pre_num, pre_dig)
+    else:
+        pre_tup = tuple()
+
+    post = match.group(3)
+    if post:
+        post_dig_match = re.search(r'\d+', post)
+        if post_dig_match:
+            post_dig = int(post_dig_match.group(0))
+        else:
+            post_dig = 0
+        post_tup = (1, post_dig)
+    else:
+        post_tup = tuple()
+
+    dev = match.group(4)
+    if dev:
+        dev_dig_match = re.search(r'\d+', dev)
+        if dev_dig_match:
+            dev_dig = int(dev_dig_match.group(0))
+        else:
+            dev_dig = 0
+        dev_tup = (-4, dev_dig)
+    else:
+        dev_tup = tuple()
+
+    normalized = [nums]
+    if pre_tup:
+        normalized.append(pre_tup)
+    if post_tup:
+        normalized.append(post_tup)
+    if dev_tup:
+        normalized.append(dev_tup)
+    # This ensures regular releases happen after dev and prerelease, but
+    # before post releases
+    if not pre_tup and not post_tup and not dev_tup:
+        normalized.append((0, 0))
+
+    return tuple(normalized)
 
 
 def _open_archive(path):
@@ -309,17 +380,99 @@
             shutil.rmtree(staging_dir)
 
 
-def _stage_requirements(deps_dir, path):
+def _sort_pep440_versions(releases, include_prerelease):
     """
-    Installs requirements without using Python to download, since
-    different services are limiting to TLS 1.2, and older version of
-    Python do not support that
+    :param releases:
+        A list of unicode string PEP 440 version numbers
 
-    :param deps_dir:
-        A unicode path to a temporary diretory to use for downloads
+    :param include_prerelease:
+        A boolean indicating if prerelease versions should be included
 
-    :param path:
-        A unicode filesystem path to a requirements file
+    :return:
+        A sorted generator of 2-element tuples:
+         0: A unicode string containing a PEP 440 version number
+         1: A tuple of tuples containing integers - this is the output of
+            _tuple_from_ver() for the PEP 440 version number and is intended
+            for comparing versions
+    """
+
+    parsed_versions = []
+    for v in releases:
+        t = _tuple_from_ver(v)
+        if not include_prerelease and t[1][0] < 0:
+            continue
+        parsed_versions.append((v, t))
+
+    return sorted(parsed_versions, key=lambda v: v[1])
+
+
+def _is_valid_python_version(python_version, requires_python):
+    """
+    Verifies the "python_version" and "requires_python" keys from a PyPi
+    download record are applicable to the current version of Python
+
+    :param python_version:
+        The "python_version" value from a PyPi download JSON structure. This
+        should be one of: "py2", "py3", "py2.py3" or "source".
+
+    :param requires_python:
+        The "requires_python" value from a PyPi download JSON structure. This
+        will be None, or a comma-separated list of conditions that must be
+        true. Ex: ">=3.5", "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
+    """
+
+    if python_version == "py2" and sys.version_info >= (3,):
+        return False
+    if python_version == "py3" and sys.version_info < (3,):
+        return False
+
+    if requires_python is not None:
+
+        def _ver_tuples(ver_str):
+            ver_str = ver_str.strip()
+            if ver_str.endswith('.*'):
+                ver_str = ver_str[:-2]
+            cond_tup = tuple(map(int, ver_str.split('.')))
+            return (sys.version_info[:len(cond_tup)], cond_tup)
+
+        for part in map(str_cls.strip, requires_python.split(',')):
+            if part.startswith('!='):
+                sys_tup, cond_tup = _ver_tuples(part[2:])
+                if sys_tup == cond_tup:
+                    return False
+            elif part.startswith('>='):
+                sys_tup, cond_tup = _ver_tuples(part[2:])
+                if sys_tup < cond_tup:
+                    return False
+            elif part.startswith('>'):
+                sys_tup, cond_tup = _ver_tuples(part[1:])
+                if sys_tup <= cond_tup:
+                    return False
+            elif part.startswith('<='):
+                sys_tup, cond_tup = _ver_tuples(part[2:])
+                if sys_tup > cond_tup:
+                    return False
+            elif part.startswith('<'):
+                sys_tup, cond_tup = _ver_tuples(part[1:])
+                if sys_tup >= cond_tup:
+                    return False
+            elif part.startswith('=='):
+                sys_tup, cond_tup = _ver_tuples(part[2:])
+                if sys_tup != cond_tup:
+                    return False
+
+    return True
+
+
+def _locate_suitable_download(downloads):
+    """
+    :param downloads:
+        A list of dicts containing a key "url", "python_version" and
+        "requires_python"
+
+    :return:
+        A unicode string URL, or None if not a valid release for the current
+        version of Python
     """
 
     valid_tags = _pep425tags()
@@ -330,8 +483,64 @@
         version_info = sys.version_info
         exe_suffix = '.%s-py%d.%d.exe' % (win_arch, version_info[0], 
version_info[1])
 
+    wheels = {}
+    whl = None
+    tar_bz2 = None
+    tar_gz = None
+    exe = None
+    for download in downloads:
+        if not _is_valid_python_version(download.get('python_version'), 
download.get('requires_python')):
+            continue
+
+        if exe_suffix and download['url'].endswith(exe_suffix):
+            exe = download['url']
+        if download['url'].endswith('.whl'):
+            parts = os.path.basename(download['url']).split('-')
+            tag_impl = parts[-3]
+            tag_abi = parts[-2]
+            tag_arch = parts[-1].split('.')[0]
+            wheels[(tag_impl, tag_abi, tag_arch)] = download['url']
+        if download['url'].endswith('.tar.bz2'):
+            tar_bz2 = download['url']
+        if download['url'].endswith('.tar.gz'):
+            tar_gz = download['url']
+
+    # Find the most-specific wheel possible
+    for tag in valid_tags:
+        if tag in wheels:
+            whl = wheels[tag]
+            break
+
+    if exe_suffix and exe:
+        url = exe
+    elif whl:
+        url = whl
+    elif tar_bz2:
+        url = tar_bz2
+    elif tar_gz:
+        url = tar_gz
+    else:
+        return None
+
+    return url
+
+
+def _stage_requirements(deps_dir, path):
+    """
+    Installs requirements without using Python to download, since
+    different services are limiting to TLS 1.2, and older version of
+    Python do not support that
+
+    :param deps_dir:
+        A unicode path to a temporary diretory to use for downloads
+
+    :param path:
+        A unicode filesystem path to a requirements file
+    """
+
     packages = _parse_requires(path)
     for p in packages:
+        url = None
         pkg = p['pkg']
         pkg_sub_dir = None
         if p['type'] == 'url':
@@ -359,53 +568,25 @@
             if os.path.exists(json_dest):
                 os.remove(json_dest)
 
-            latest = pkg_info['info']['version']
-            if p['type'] == '>=':
-                if _tuple_from_ver(p['ver']) > _tuple_from_ver(latest):
-                    raise Exception('Unable to find version %s of %s, newest 
is %s' % (p['ver'], pkg, latest))
-                version = latest
-            elif p['type'] == '==':
+            if p['type'] == '==':
                 if p['ver'] not in pkg_info['releases']:
                     raise Exception('Unable to find version %s of %s' % 
(p['ver'], pkg))
-                version = p['ver']
-            else:
-                version = latest
-
-            wheels = {}
-            whl = None
-            tar_bz2 = None
-            tar_gz = None
-            exe = None
-            for download in pkg_info['releases'][version]:
-                if exe_suffix and download['url'].endswith(exe_suffix):
-                    exe = download['url']
-                if download['url'].endswith('.whl'):
-                    parts = os.path.basename(download['url']).split('-')
-                    tag_impl = parts[-3]
-                    tag_abi = parts[-2]
-                    tag_arch = parts[-1].split('.')[0]
-                    wheels[(tag_impl, tag_abi, tag_arch)] = download['url']
-                if download['url'].endswith('.tar.bz2'):
-                    tar_bz2 = download['url']
-                if download['url'].endswith('.tar.gz'):
-                    tar_gz = download['url']
-
-            # Find the most-specific wheel possible
-            for tag in valid_tags:
-                if tag in wheels:
-                    whl = wheels[tag]
-                    break
-
-            if exe_suffix and exe:
-                url = exe
-            elif whl:
-                url = whl
-            elif tar_bz2:
-                url = tar_bz2
-            elif tar_gz:
-                url = tar_gz
+                url = _locate_suitable_download(pkg_info['releases'][p['ver']])
+                if not url:
+                    raise Exception('Unable to find a compatible download of 
%s == %s' % (pkg, p['ver']))
             else:
-                raise Exception('Unable to find suitable download for %s' % 
pkg)
+                p_ver_tup = _tuple_from_ver(p['ver'])
+                for ver_str, ver_tup in 
reversed(_sort_pep440_versions(pkg_info['releases'], False)):
+                    if p['type'] == '>=' and ver_tup < p_ver_tup:
+                        break
+                    url = 
_locate_suitable_download(pkg_info['releases'][ver_str])
+                    if url:
+                        break
+                if not url:
+                    if p['type'] == '>=':
+                        raise Exception('Unable to find a compatible download 
of %s >= %s' % (pkg, p['ver']))
+                    else:
+                        raise Exception('Unable to find a compatible download 
of %s' % pkg)
 
         local_path = _download(url, deps_dir)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/readme.md 
new/asn1crypto-1.4.0/readme.md
--- old/asn1crypto-1.3.0/readme.md      2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/readme.md      2020-07-28 14:31:23.000000000 +0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/setup.py 
new/asn1crypto-1.4.0/setup.py
--- old/asn1crypto-1.3.0/setup.py       2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/setup.py       2020-07-28 14:31:23.000000000 +0200
@@ -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__))
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/tests/__init__.py 
new/asn1crypto-1.4.0/tests/__init__.py
--- old/asn1crypto-1.3.0/tests/__init__.py      2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/tests/__init__.py      2020-07-28 14:31:23.000000000 
+0200
@@ -6,8 +6,8 @@
 import unittest
 
 
-__version__ = '1.3.0'
-__version_info__ = (1, 3, 0)
+__version__ = '1.4.0'
+__version_info__ = (1, 4, 0)
 
 
 def _import_from(mod, path, mod_dir=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/tests/setup.py 
new/asn1crypto-1.4.0/tests/setup.py
--- old/asn1crypto-1.3.0/tests/setup.py 2020-01-04 15:06:42.000000000 +0100
+++ new/asn1crypto-1.4.0/tests/setup.py 2020-07-28 14:31:23.000000000 +0200
@@ -10,10 +10,9 @@
 
 
 PACKAGE_NAME = 'asn1crypto'
-PACKAGE_VERSION = '1.3.0'
+PACKAGE_VERSION = '1.4.0'
 TEST_PACKAGE_NAME = '%s_tests' % PACKAGE_NAME
 TESTS_ROOT = os.path.dirname(os.path.abspath(__file__))
-PACKAGE_ROOT = os.path.abspath(os.path.join(TESTS_ROOT, '..'))
 
 
 # setuptools 38.6.0 and newer know about long_description_content_type, but
@@ -60,7 +59,7 @@
         if not os.path.exists(egg_info_path):
             os.mkdir(egg_info_path)
         shutil.copy2(
-            os.path.join(PACKAGE_ROOT, 'LICENSE'),
+            os.path.join(TESTS_ROOT, 'LICENSE'),
             os.path.join(egg_info_path, 'LICENSE')
         )
         egg_info.run(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/tests/test_core.py 
new/asn1crypto-1.4.0/tests/test_core.py
--- old/asn1crypto-1.3.0/tests/test_core.py     2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/tests/test_core.py     2020-07-28 14:31:23.000000000 
+0200
@@ -64,7 +64,7 @@
 
     _oid_pair = ('id', 'value')
     _oid_specs = {
-        '3.4.5': Seq,
+        '2.3.4.5': Seq,
     }
 
 
@@ -76,7 +76,7 @@
 
     _oid_pair = ('id', 'value')
     _oid_specs = {
-        '3.4.5': Seq,
+        '2.3.4.5': Seq,
     }
 
 
@@ -1314,14 +1314,14 @@
     def test_wrong_asn1value3(self):
         with self.assertRaises(TypeError):
             NestSeqAny({
-                'id': '3.4.5',
+                'id': '2.3.4.5',
                 'value': core.Integer(1)
             })
 
     def test_wrong_asn1value4(self):
         with self.assertRaises(TypeError):
             NestSeqExplicit({
-                'id': '3.4.5',
+                'id': '2.3.4.5',
                 'value': core.Integer(1)
             })
 
@@ -1334,3 +1334,32 @@
         b.set_encoded_width(4)
         self.assertEqual(1, b.native)
         self.assertEqual(b'\x04\x04\x00\x00\x00\x01', b.dump())
+
+    @staticmethod
+    def object_identifier_info():
+        return (
+            ("0.0", b"\x06\x01\x00"),
+            ("0.39", b"\x06\x01\x27"),
+            ("1.0", b"\x06\x01\x28"),
+            ("1.39", b"\x06\x01\x4f"),
+            ("2.0", b"\x06\x01\x50"),
+            ("2.39", b"\x06\x01\x77"),
+            ("2.100.3", b"\x06\x03\x81\x34\x03"),
+            ("2.16.840.1.113730.1.1", 
b"\x06\x09\x60\x86\x48\x01\x86\xf8\x42\x01\x01"),
+        )
+
+    @data('object_identifier_info')
+    def object_identifier(self, native, der_bytes):
+        oid = core.ObjectIdentifier(native)
+        self.assertEqual(der_bytes, oid.dump())
+        self.assertEqual(native, core.ObjectIdentifier.load(der_bytes).native)
+
+    def test_broken_object_identifier(self):
+        with self.assertRaisesRegex(ValueError, "First arc must be "):
+            core.ObjectIdentifier("3.4.5")
+
+        with self.assertRaisesRegex(ValueError, "Second arc must be "):
+            core.ObjectIdentifier("1.100.1000")
+
+        with self.assertRaisesRegex(ValueError, "Second arc must be "):
+            core.ObjectIdentifier("0.40")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/asn1crypto-1.3.0/tests/test_keys.py 
new/asn1crypto-1.4.0/tests/test_keys.py
--- old/asn1crypto-1.3.0/tests/test_keys.py     2020-01-04 15:06:42.000000000 
+0100
+++ new/asn1crypto-1.4.0/tests/test_keys.py     2020-07-28 14:31:23.000000000 
+0200
@@ -1,8 +1,9 @@
 # coding: utf-8
 from __future__ import unicode_literals, division, absolute_import, 
print_function
 
-import unittest
 import os
+import sys
+import unittest
 
 from asn1crypto import keys, core, util
 
@@ -11,6 +12,11 @@
 
 patch()
 
+if sys.version_info < (3,):
+    int_types = (int, long)  # noqa
+else:
+    int_types = int
+
 tests_root = os.path.dirname(__file__)
 fixtures_dir = os.path.join(tests_root, 'fixtures')
 
@@ -481,7 +487,9 @@
         with open(os.path.join(fixtures_dir, public_key_file), 'rb') as f:
             public_key = keys.PublicKeyInfo.load(f.read())
 
+        self.assertIsInstance(private_key.bit_size, int_types)
         self.assertEqual(bit_size, private_key.bit_size)
+        self.assertIsInstance(public_key.bit_size, int_types)
         self.assertEqual(bit_size, public_key.bit_size)
 
     @staticmethod


Reply via email to