[Python-modules-commits] [python-bcrypt] 01/05: Import python-bcrypt_3.1.2.orig.tar.xz

Daniel Stender stender at moszumanska.debian.org
Fri Dec 23 19:19:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

stender pushed a commit to branch master
in repository python-bcrypt.

commit b10c59bd53eab4b1526733518157e6b6cf7098ae
Author: Daniel Stender <stender at debian.org>
Date:   Fri Dec 23 20:11:57 2016 +0100

    Import python-bcrypt_3.1.2.orig.tar.xz
---
 MANIFEST.in                  | 4 +++-
 PKG-INFO                     | 8 +++++++-
 README.rst                   | 6 ++++++
 setup.py                     | 3 ++-
 src/_csrc/portable_endian.h  | 4 ++--
 src/bcrypt.egg-info/PKG-INFO | 8 +++++++-
 src/bcrypt/__about__.py      | 2 +-
 src/bcrypt/__init__.py       | 5 ++++-
 tests/test_bcrypt.py         | 9 +++++++++
 9 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index 93a4480..200c135 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,6 +6,8 @@ include src/build_bcrypt.py
 recursive-include src/_csrc *
 recursive-include tests *.py
 
-exclude requirements.txt tasks.py .travis.yml
+exclude requirements.txt tasks.py .travis.yml wheel-scripts
+
+recursive-exclude wheel-scripts *
 
 prune .travis
diff --git a/PKG-INFO b/PKG-INFO
index dba40e4..f2d621f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: bcrypt
-Version: 3.1.1
+Version: 3.1.2
 Summary: Modern password hashing for your software and your servers
 Home-page: https://github.com/pyca/bcrypt/
 Author: The Python Cryptographic Authority developers
@@ -45,6 +45,12 @@ Description: bcrypt
         Changelog
         =========
         
+        3.1.2
+        -----
+        * Fixed a compile issue affecting big endian platforms.
+        * Fixed invalid escape sequence warnings on Python 3.6.
+        * Fixed building in non-UTF8 environments on Python 2.
+        
         3.1.1
         -----
         * Resolved a ``UserWarning`` when used with ``cffi`` 1.8.3.
diff --git a/README.rst b/README.rst
index ce04af0..fc08199 100644
--- a/README.rst
+++ b/README.rst
@@ -37,6 +37,12 @@ For Fedora and RHEL-derivatives, the following command will ensure that the requ
 Changelog
 =========
 
+3.1.2
+-----
+* Fixed a compile issue affecting big endian platforms.
+* Fixed invalid escape sequence warnings on Python 3.6.
+* Fixed building in non-UTF8 environments on Python 2.
+
 3.1.1
 -----
 * Resolved a ``UserWarning`` when used with ``cffi`` 1.8.3.
diff --git a/setup.py b/setup.py
index 060e675..3ec6579 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+import io
 import platform
 import sys
 from distutils.command.build import build
@@ -192,7 +193,7 @@ setup(
     version=__about__["__version__"],
 
     description=__about__["__summary__"],
-    long_description=open("README.rst").read(),
+    long_description=io.open("README.rst", encoding='utf-8').read(),
     url=__about__["__uri__"],
     license=__about__["__license__"],
 
diff --git a/src/_csrc/portable_endian.h b/src/_csrc/portable_endian.h
index 848803b..4816331 100644
--- a/src/_csrc/portable_endian.h
+++ b/src/_csrc/portable_endian.h
@@ -48,9 +48,9 @@
 #           define le64toh(x) (x)
 #       elif defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)
 #           define htobe16(x) (x)
-#           define htole16(x) ((((((uint16_t)(x)) >> 8))|((((uint16_t)(x)) << 8)))
+#           define htole16(x) (((((uint16_t)(x)) >> 8))|((((uint16_t)(x)) << 8)))
 #           define be16toh(x) (x)
-#           define le16toh(x) ((((((uint16_t)(x)) >> 8))|((((uint16_t)(x)) << 8)))
+#           define le16toh(x) (((((uint16_t)(x)) >> 8))|((((uint16_t)(x)) << 8)))
 
 #           define htobe32(x) (x)
 #           define htole32(x) (((uint32_t)htole16(((uint16_t)(((uint32_t)(x)) >> 16)))) | (((uint32_t)htole16(((uint16_t)(x)))) << 16))
diff --git a/src/bcrypt.egg-info/PKG-INFO b/src/bcrypt.egg-info/PKG-INFO
index dba40e4..f2d621f 100644
--- a/src/bcrypt.egg-info/PKG-INFO
+++ b/src/bcrypt.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: bcrypt
-Version: 3.1.1
+Version: 3.1.2
 Summary: Modern password hashing for your software and your servers
 Home-page: https://github.com/pyca/bcrypt/
 Author: The Python Cryptographic Authority developers
@@ -45,6 +45,12 @@ Description: bcrypt
         Changelog
         =========
         
+        3.1.2
+        -----
+        * Fixed a compile issue affecting big endian platforms.
+        * Fixed invalid escape sequence warnings on Python 3.6.
+        * Fixed building in non-UTF8 environments on Python 2.
+        
         3.1.1
         -----
         * Resolved a ``UserWarning`` when used with ``cffi`` 1.8.3.
diff --git a/src/bcrypt/__about__.py b/src/bcrypt/__about__.py
index f0e9882..f8940a3 100644
--- a/src/bcrypt/__about__.py
+++ b/src/bcrypt/__about__.py
@@ -26,7 +26,7 @@ __title__ = "bcrypt"
 __summary__ = "Modern password hashing for your software and your servers"
 __uri__ = "https://github.com/pyca/bcrypt/"
 
-__version__ = "3.1.1"
+__version__ = "3.1.2"
 
 __author__ = "The Python Cryptographic Authority developers"
 __email__ = "cryptography-dev at python.org"
diff --git a/src/bcrypt/__init__.py b/src/bcrypt/__init__.py
index cd779a6..049e454 100644
--- a/src/bcrypt/__init__.py
+++ b/src/bcrypt/__init__.py
@@ -36,7 +36,7 @@ __all__ = [
 ]
 
 
-_normalize_re = re.compile(b"^\$2y\$")
+_normalize_re = re.compile(br"^\$2y\$")
 
 
 def gensalt(rounds=12, prefix=b"2b"):
@@ -106,6 +106,9 @@ def checkpw(password, hashed_password):
 
     ret = hashpw(password, hashed_password)
 
+    if len(ret) != len(hashed_password):
+        return False
+
     return _bcrypt.lib.timingsafe_bcmp(ret, hashed_password, len(ret)) == 0
 
 
diff --git a/tests/test_bcrypt.py b/tests/test_bcrypt.py
index d9bde72..fa9a410 100644
--- a/tests/test_bcrypt.py
+++ b/tests/test_bcrypt.py
@@ -308,6 +308,15 @@ def test_hashpw_nul_byte():
         bcrypt.hashpw(b"abc\0def", salt)
 
 
+def test_checkpw_extra_data():
+    salt = bcrypt.gensalt(4)
+    hashed = bcrypt.hashpw(b"abc", salt)
+
+    assert bcrypt.checkpw(b"abc", hashed)
+    assert bcrypt.checkpw(b"abc", hashed + b"extra") is False
+    assert bcrypt.checkpw(b"abc", hashed[:-10]) is False
+
+
 @pytest.mark.parametrize(
     ("rounds", "password", "salt", "expected"),
     [[

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-bcrypt.git



More information about the Python-modules-commits mailing list