summaryrefslogtreecommitdiff
path: root/passlib/tests
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-04-17 22:23:35 -0400
committerEli Collins <elic@assurancetechnologies.com>2012-04-17 22:23:35 -0400
commite81b32667429c6486a63f4a2c2bf446ba2c8ea90 (patch)
treee553bcda4481228fe2d953729e3fbb1122d44455 /passlib/tests
parent0cade3487dea5d8117b9f5e045c9fd9425778aec (diff)
downloadpasslib-e81b32667429c6486a63f4a2c2bf446ba2c8ea90.tar.gz
changed bcrypt's os_crypt backend to try alternatives before bailing.
Diffstat (limited to 'passlib/tests')
-rw-r--r--passlib/tests/test_handlers.py3
-rw-r--r--passlib/tests/utils.py5
2 files changed, 3 insertions, 5 deletions
diff --git a/passlib/tests/test_handlers.py b/passlib/tests/test_handlers.py
index f566b4f..61cdc8f 100644
--- a/passlib/tests/test_handlers.py
+++ b/passlib/tests/test_handlers.py
@@ -59,7 +59,6 @@ class _bcrypt_test(HandlerCase):
"base for BCrypt test cases"
handler = hash.bcrypt
secret_size = 72
- os_crypt_has_fallback = False
known_correct_hashes = [
#
@@ -204,6 +203,8 @@ class _bcrypt_test(HandlerCase):
#===============================================================
def os_supports_ident(self, hash):
"check if OS crypt is expected to support given ident"
+ if hash is None:
+ return True
# most OSes won't support 2x/2y
# XXX: definitely not the BSDs, but what about the linux variants?
if hash.startswith("$2x$") or hash.startswith("$2y$"):
diff --git a/passlib/tests/utils.py b/passlib/tests/utils.py
index 7d7b205..5cbb427 100644
--- a/passlib/tests/utils.py
+++ b/passlib/tests/utils.py
@@ -1795,9 +1795,6 @@ class OsCryptMixin(HandlerCase):
# encodeds as os.platform prefixes.
platform_crypt_support = dict()
- # hack for bcrypt, indicating os_crypt backend has no fallback
- os_crypt_has_fallback = True
-
#=========================================================
# instance attrs
#=========================================================
@@ -1876,7 +1873,7 @@ class OsCryptMixin(HandlerCase):
# set safe_crypt to return None
setter = self._use_mock_crypt()
setter(None)
- if self.os_crypt_has_fallback and _find_alternate_backend(self.handler, "os_crypt"):
+ if _find_alternate_backend(self.handler, "os_crypt"):
# handler should have a fallback to use
h1 = self.do_encrypt("stub")
h2 = self.do_genhash("stub", h1)