Hello community,

here is the log from the commit of package python-ntlm-auth for 
openSUSE:Factory checked in at 2019-04-11 12:17:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ntlm-auth (Old)
 and      /work/SRC/openSUSE:Factory/.python-ntlm-auth.new.27019 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ntlm-auth"

Thu Apr 11 12:17:42 2019 rev:5 rq:693003 version:1.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ntlm-auth/python-ntlm-auth.changes        
2019-01-03 18:07:21.104101779 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-ntlm-auth.new.27019/python-ntlm-auth.changes 
    2019-04-11 12:17:46.672949888 +0200
@@ -1,0 +2,10 @@
+Wed Apr 10 10:15:12 UTC 2019 - Martin Hauke <[email protected]>
+
+- Update to version 1.3.0
+  * Added optional dependency for cryptography for faster RC4 cipher
+    calls.
+  * Removed the deprecation warning for Ntlm, this is still advised
+    not to use but there's no major harm keep it in place for older
+    hosts.
+
+-------------------------------------------------------------------

Old:
----
  python-ntlm-auth-1.2.0.tar.gz

New:
----
  python-ntlm-auth-1.3.0.tar.gz

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

Other differences:
------------------
++++++ python-ntlm-auth.spec ++++++
--- /var/tmp/diff_new_pack.ql3DdA/_old  2019-04-11 12:17:47.552950332 +0200
+++ /var/tmp/diff_new_pack.ql3DdA/_new  2019-04-11 12:17:47.556950334 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-ntlm-auth
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,25 +12,27 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-ntlm-auth
-Version:        1.2.0
+Version:        1.3.0
 Release:        0
 Summary:        NTLM low-level Python library
 License:        MIT
 Group:          Development/Languages/Python
 Url:            https://github.com/jborean93/ntlm-auth
 Source:         
https://github.com/jborean93/ntlm-auth/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+BuildRequires:  %{python_module cryptography}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module requests}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Suggests:       python-ordereddict
+Recommends:     python-cryptography
 BuildArch:      noarch
 %python_subpackages
 

++++++ python-ntlm-auth-1.2.0.tar.gz -> python-ntlm-auth-1.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/.travis.yml 
new/ntlm-auth-1.3.0/.travis.yml
--- old/ntlm-auth-1.2.0/.travis.yml     2018-06-07 09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/.travis.yml     2019-04-09 02:00:52.000000000 +0200
@@ -1,17 +1,30 @@
 language: python
 
-python:
-- "2.6"
-- "2.7"
-- "3.4"
-- "3.5"
-- "3.6"
+dist: xenial
+
+matrix:
+  include:
+  - python: 2.6
+    dist: trusty
+  - python: 2.7
+  - python: 3.4
+    dist: trusty
+  - python: 3.5
+    dist: trusty
+  - python: 3.6
+  - python: 3.7
+  - python: 3.8-dev
+
+  # 3.8 is still an alpha and this is just running to make sure nothing major
+  # breaks but we don't want it to stop the build
+  allow_failures:
+  - python: 3.8-dev
 
 install:
-- pip install -U pip setuptools
-- pip install .
+- pip install --upgrade pip setuptools
 - pip install -r requirements-test.txt
-- pip install python-coveralls
+- pip install .
+- pip install coveralls
 
 script:
 - py.test -v --pep8 --cov ntlm_auth --cov-report term-missing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/CHANGES.md 
new/ntlm-auth-1.3.0/CHANGES.md
--- old/ntlm-auth-1.2.0/CHANGES.md      2018-06-07 09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/CHANGES.md      2019-04-09 02:00:52.000000000 +0200
@@ -1,5 +1,11 @@
 # Changes
 
+## 1.3.0 (Apr 9, 2019)
+
+* Added optional dependency for `cryptography` for faster RC4 cipher calls
+* Removed the deprecation warning for Ntlm, this is still advised not to use 
but there's no major harm keep it in place for older hosts
+* Add CI test for Python 3.7 and 3.8
+
 ## 1.2.0 (Jun 7, 2018)
 
 * Deprecated ntlm_auth.ntlm.Ntlm in favour of ntlm_auth.ntlm.NtlmContext
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/appveyor.yml 
new/ntlm-auth-1.3.0/appveyor.yml
--- old/ntlm-auth-1.2.0/appveyor.yml    2018-06-07 09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/appveyor.yml    2019-04-09 02:00:52.000000000 +0200
@@ -19,6 +19,8 @@
   - PYTHON: Python35-x64
   - PYTHON: Python36
   - PYTHON: Python36-x64
+  - PYTHON: Python37
+  - PYTHON: Python37-x64
 
 services:
 - iis
@@ -33,13 +35,13 @@
     $env:NTLM_PASSWORD = 
[Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
 NT\CurrentVersion\Winlogon", "DefaultPassword", '')
 
 install:
-- ps: |
-    pip install -U pip setuptools
-    pip install .
-    pip install -r requirements-test.txt
+- cmd: python -m pip install --upgrade pip
+- cmd: pip install --upgrade setuptools
+- cmd: pip install -r requirements-test.txt
+- cmd: pip install .[cryptography]
 - cmd: PowerShell.exe -File appveyor\setup_iis.ps1
 
 build: off
 
 test_script:
-- ps: py.test -v --pep8 --cov ntlm_auth --cov-report term-missing
+- cmd: py.test -v --pep8 --cov ntlm_auth --cov-report term-missing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/ntlm_auth/compute_response.py 
new/ntlm-auth-1.3.0/ntlm_auth/compute_response.py
--- old/ntlm-auth-1.2.0/ntlm_auth/compute_response.py   2018-06-07 
09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/ntlm_auth/compute_response.py   2019-04-09 
02:00:52.000000000 +0200
@@ -8,7 +8,6 @@
 import os
 import struct
 import time
-import warnings
 
 import ntlm_auth.compute_hash as comphash
 import ntlm_auth.compute_keys as compkeys
@@ -180,10 +179,9 @@
                     struct.pack("<L", AvFlags.MIC_PROVIDED)
 
             if server_certificate_hash is not None and cbt_data is None:
-                warnings.warn("Manually creating the cbt stuct from the cert "
-                              "hash will be removed in a newer version of "
-                              "ntlm-auth. Send the actual CBT struct using "
-                              "cbt_data instead", DeprecationWarning)
+                # Older method of creating CBT struct based on the cert hash.
+                # This should be avoided in favour of an explicit
+                # GssChannelBindingStruct being passed in.
                 certificate_digest = base64.b16decode(server_certificate_hash)
 
                 cbt_data = GssChannelBindingsStruct()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/ntlm_auth/ntlm.py 
new/ntlm-auth-1.3.0/ntlm_auth/ntlm.py
--- old/ntlm-auth-1.2.0/ntlm_auth/ntlm.py       2018-06-07 09:32:00.000000000 
+0200
+++ new/ntlm-auth-1.3.0/ntlm_auth/ntlm.py       2019-04-09 02:00:52.000000000 
+0200
@@ -3,7 +3,6 @@
 
 import base64
 import struct
-import warnings
 
 from ntlm_auth.constants import NegotiateFlags
 from ntlm_auth.exceptions import NoAuthContextError
@@ -16,7 +15,7 @@
 
     def __init__(self, username, password, domain=None, workstation=None,
                  cbt_data=None, ntlm_compatibility=3):
-        """
+        r"""
         Initialises a NTLM context to use when authenticating using the NTLM
         protocol.
         Initialises the NTLM context to use when sending and receiving messages
@@ -144,9 +143,6 @@
         self._context = NtlmContext(None, None,
                                     ntlm_compatibility=ntlm_compatibility)
         self._challenge_token = None
-        warnings.warn("Using Ntlm() is deprecated and will be removed in a "
-                      "future version. Use NtlmContext() instead",
-                      DeprecationWarning)
 
     @property
     def negotiate_flags(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/ntlm_auth/rc4.py 
new/ntlm-auth-1.3.0/ntlm_auth/rc4.py
--- old/ntlm-auth-1.2.0/ntlm_auth/rc4.py        2018-06-07 09:32:00.000000000 
+0200
+++ new/ntlm-auth-1.3.0/ntlm_auth/rc4.py        2019-04-09 02:00:52.000000000 
+0200
@@ -3,8 +3,27 @@
 
 import struct
 
+# Favour cryptography over our Python implementation as it is a lot faster
+try:
+    from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, 
modes
+    from cryptography.hazmat.backends import default_backend
+    HAS_CRYPTOGRAPHY = True
+except ImportError:  # pragma: no cover
+    HAS_CRYPTOGRAPHY = False
 
-class ARC4(object):
+
+class _CryptographyARC4(object):
+
+    def __init__(self, key):
+        algo = algorithms.ARC4(key)
+        cipher = Cipher(algo, mode=None, backend=default_backend())
+        self._encryptor = cipher.encryptor()
+
+    def update(self, value):
+        return self._encryptor.update(value)
+
+
+class _PythonARC4(object):
     state = None
     i = 0
     j = 0
@@ -40,3 +59,9 @@
             self.state[self.i], self.state[self.j] = \
                 self.state[self.j], self.state[self.i]
             yield self.state[(self.state[self.i] + self.state[self.j]) % 256]
+
+
+if HAS_CRYPTOGRAPHY:
+    ARC4 = _CryptographyARC4
+else:  # pragma: no cover
+    ARC4 = _PythonARC4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/requirements-test.txt 
new/ntlm-auth-1.3.0/requirements-test.txt
--- old/ntlm-auth-1.2.0/requirements-test.txt   2018-06-07 09:32:00.000000000 
+0200
+++ new/ntlm-auth-1.3.0/requirements-test.txt   2019-04-09 02:00:52.000000000 
+0200
@@ -1,4 +1,7 @@
-pytest<=3.2.5
+pytest==3.2.5; python_version<"2.7"
+pytest>=3.6; python_version>="2.7"
 pytest-cov
 pytest-pep8
 requests
+cryptography<2.2; python_version<"2.7"
+cryptography; python_version>="2.7"
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/setup.cfg 
new/ntlm-auth-1.3.0/setup.cfg
--- old/ntlm-auth-1.2.0/setup.cfg       2018-06-07 09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/setup.cfg       2019-04-09 02:00:52.000000000 +0200
@@ -2,4 +2,7 @@
 universal = 1
 
 [metadata]
-license_file = LICENSE
\ No newline at end of file
+license_file = LICENSE
+
+[tool:pytest]
+pep8maxlinelength = 119
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/setup.py new/ntlm-auth-1.3.0/setup.py
--- old/ntlm-auth-1.2.0/setup.py        2018-06-07 09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/setup.py        2019-04-09 02:00:52.000000000 +0200
@@ -13,12 +13,20 @@
 
 setup(
     name='ntlm-auth',
-    version='1.2.0',
+    version='1.3.0',
     packages=['ntlm_auth'],
     install_requires=[],
     extras_require={
         ':python_version<"2.7"': [
             'ordereddict'
+        ],
+        # Adds faster RC4 message encryption, optional as we can fallback
+        # to the slower Python imp.
+        'cryptography:python_version<"2.7"': [
+            'cryptography<2.2'  # 2.2+ droppped Python 2.6 support
+        ],
+        'cryptography:python_version>="2.7"': [
+            'cryptography'
         ]
     },
     author='Jordan Borean',
@@ -28,6 +36,7 @@
     long_description=long_description,
     keywords='authentication auth microsoft ntlm lm',
     license='MIT',
+    python_requires='>=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
     classifiers=[
         'Development Status :: 5 - Production/Stable',
         'License :: OSI Approved :: MIT License',
@@ -37,6 +46,7 @@
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
-        'Programming Language :: Python :: 3.6'
+        'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
     ],
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/tests/test_rc4.py 
new/ntlm-auth-1.3.0/tests/test_rc4.py
--- old/ntlm-auth-1.2.0/tests/test_rc4.py       2018-06-07 09:32:00.000000000 
+0200
+++ new/ntlm-auth-1.3.0/tests/test_rc4.py       2019-04-09 02:00:52.000000000 
+0200
@@ -1,10 +1,18 @@
-from ntlm_auth.rc4 import ARC4
+import pytest
 
+from ntlm_auth.rc4 import _CryptographyARC4, _PythonARC4
 
+
[email protected](autouse=True)
+def rc4(has_crypto):
+    return _CryptographyARC4 if has_crypto else _PythonARC4
+
+
[email protected]('has_crypto', [True, False])
 class TestARC4(object):
 
-    def test_encrypt_40bit_key(self):
-        test_handle = ARC4(b"\x01\x02\x03\x04\x05")
+    def test_encrypt_40bit_key(self, rc4):
+        test_handle = rc4(b"\x01\x02\x03\x04\x05")
         expected1 = b"\xb2\x39\x63\x05\xf0\x3d\xc0\x27" \
                     b"\xcc\xc3\x52\x4a\x0a\x11\x18\xa8"
         expected2 = b"\x69\x82\x94\x4f\x18\xfc\x82\xd5" \
@@ -14,8 +22,8 @@
         assert actual1 == expected1
         assert actual2 == expected2
 
-    def test_decrypt_40bit_key(self):
-        test_handle = ARC4(b"\x01\x02\x03\x04\x05")
+    def test_decrypt_40bit_key(self, rc4):
+        test_handle = rc4(b"\x01\x02\x03\x04\x05")
         test1 = b"\xb2\x39\x63\x05\xf0\x3d\xc0\x27" \
                 b"\xcc\xc3\x52\x4a\x0a\x11\x18\xa8"
         test2 = b"\x69\x82\x94\x4f\x18\xfc\x82\xd5" \
@@ -26,8 +34,8 @@
         assert actual1 == expected
         assert actual2 == expected
 
-    def test_encrypt_56bit_key(self):
-        test_handle = ARC4(b"\x01\x02\x03\x04\x05\x06\x07")
+    def test_encrypt_56bit_key(self, rc4):
+        test_handle = rc4(b"\x01\x02\x03\x04\x05\x06\x07")
         expected1 = b"\x29\x3f\x02\xd4\x7f\x37\xc9\xb6" \
                     b"\x33\xf2\xaf\x52\x85\xfe\xb4\x6b"
         expected2 = b"\xe6\x20\xf1\x39\x0d\x19\xbd\x84" \
@@ -37,8 +45,8 @@
         assert actual1 == expected1
         assert actual2 == expected2
 
-    def test_decrypt_56bit_key(self):
-        test_handle = ARC4(b"\x01\x02\x03\x04\x05\x06\x07")
+    def test_decrypt_56bit_key(self, rc4):
+        test_handle = rc4(b"\x01\x02\x03\x04\x05\x06\x07")
         test1 = b"\x29\x3f\x02\xd4\x7f\x37\xc9\xb6" \
                 b"\x33\xf2\xaf\x52\x85\xfe\xb4\x6b"
         test2 = b"\xe6\x20\xf1\x39\x0d\x19\xbd\x84" \
@@ -49,9 +57,9 @@
         assert actual1 == expected
         assert actual2 == expected
 
-    def test_encrypt_128bit_key(self):
-        test_handle = ARC4(b"\x01\x02\x03\x04\x05\x06\x07\x08"
-                           b"\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10")
+    def test_encrypt_128bit_key(self, rc4):
+        test_handle = rc4(b"\x01\x02\x03\x04\x05\x06\x07\x08"
+                          b"\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10")
         expected1 = b"\x9a\xc7\xcc\x9a\x60\x9d\x1e\xf7" \
                     b"\xb2\x93\x28\x99\xcd\xe4\x1b\x97"
         expected2 = b"\x52\x48\xc4\x95\x90\x14\x12\x6a" \
@@ -61,9 +69,9 @@
         assert actual1 == expected1
         assert actual2 == expected2
 
-    def test_decrypt_128bit_key(self):
-        test_handle = ARC4(b"\x01\x02\x03\x04\x05\x06\x07\x08"
-                           b"\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10")
+    def test_decrypt_128bit_key(self, rc4):
+        test_handle = rc4(b"\x01\x02\x03\x04\x05\x06\x07\x08"
+                          b"\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10")
         test1 = b"\x9a\xc7\xcc\x9a\x60\x9d\x1e\xf7" \
                 b"\xb2\x93\x28\x99\xcd\xe4\x1b\x97"
         test2 = b"\x52\x48\xc4\x95\x90\x14\x12\x6a" \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ntlm-auth-1.2.0/tox.ini new/ntlm-auth-1.3.0/tox.ini
--- old/ntlm-auth-1.2.0/tox.ini 2018-06-07 09:32:00.000000000 +0200
+++ new/ntlm-auth-1.3.0/tox.ini 2019-04-09 02:00:52.000000000 +0200
@@ -1,5 +1,5 @@
 [tox]
-envlist = py26,py27,py33,py34,py35,py36
+envlist = py27,py34,py35,py36,py37,py38
 
 [testenv]
 deps= -rrequirements-test.txt


Reply via email to