summaryrefslogtreecommitdiff
path: root/passlib/hosts.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-04-17 23:14:51 -0400
committerEli Collins <elic@assurancetechnologies.com>2012-04-17 23:14:51 -0400
commit64ab6fc89b497efa9169f11d55251e417c4db0ba (patch)
treeb3f6f5dc27b87a6bc90cb3686fa98239ee8ff053 /passlib/hosts.py
parent8eb4c4d3b58eec6802c698ddbf357b2fd243a68c (diff)
parentcd029846fdc0c3d7ffc7f53caad4579e7e0e8725 (diff)
downloadpasslib-ironpython-support-dev.tar.gz
Merge from defaultironpython-support-dev
Diffstat (limited to 'passlib/hosts.py')
-rw-r--r--passlib/hosts.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/passlib/hosts.py b/passlib/hosts.py
index 5d3abc6..dc3ce83 100644
--- a/passlib/hosts.py
+++ b/passlib/hosts.py
@@ -20,10 +20,10 @@ __all__ = [
]
#=========================================================
-#linux support
+# linux support
#=========================================================
-#known platform names - linux2
+# known platform names - linux2
linux_context = linux2_context = LazyCryptContext(
schemes = [ "sha512_crypt", "sha256_crypt", "md5_crypt",
@@ -32,7 +32,7 @@ linux_context = linux2_context = LazyCryptContext(
)
#=========================================================
-#bsd support
+# bsd support
#=========================================================
#known platform names -
@@ -59,13 +59,16 @@ openbsd_context = LazyCryptContext(["bcrypt", "md5_crypt", "bsdi_crypt",
netbsd_context = LazyCryptContext(["bcrypt", "sha1_crypt", "md5_crypt",
"bsdi_crypt", "des_crypt", "unix_disabled"])
+# XXX: include darwin in this list? it's got a BSD crypt variant,
+# but that's not what it uses for user passwords.
+
#=========================================================
#current host
#=========================================================
if has_crypt:
- #NOTE: this is basically mimicing the output of os crypt(),
- #except that it uses passlib's (usually stronger) defaults settings,
- #and can be introspected and used much more flexibly.
+ # NOTE: this is basically mimicing the output of os crypt(),
+ # except that it uses passlib's (usually stronger) defaults settings,
+ # and can be introspected and used much more flexibly.
def _iter_os_crypt_schemes():
"helper which iterates over supported os_crypt schemes"
@@ -76,11 +79,11 @@ if has_crypt:
found = True
yield name
if found:
- #only offer fallback if there's another scheme in front,
- #as this can't actually hash any passwords
+ # only offer disabled handler if there's another scheme in front,
+ # as this can't actually hash any passwords
yield "unix_disabled"
- else:
- #no idea what OS this could happen on, but just in case...
+ else: # pragma: no cover
+ # no idea what OS this could happen on...
warn("crypt.crypt() function is present, but doesn't support any "
"formats known to passlib!", PasslibRuntimeWarning)