summaryrefslogtreecommitdiff
path: root/passlib
diff options
context:
space:
mode:
Diffstat (limited to 'passlib')
-rw-r--r--passlib/apache.py6
-rw-r--r--passlib/handlers/md5_crypt.py7
2 files changed, 12 insertions, 1 deletions
diff --git a/passlib/apache.py b/passlib/apache.py
index ce4dbb9..e985667 100644
--- a/passlib/apache.py
+++ b/passlib/apache.py
@@ -372,7 +372,11 @@ class _CommonFile(object):
#=========================================================
# FIXME: apr_md5_crypt technically the default only for windows, netware and tpf.
-# TODO: find out if htpasswd's "crypt" mode is crypt *call* or just des_crypt implementation.
+# TODO: find out if htpasswd's "crypt" mode is a crypt() *call* or just des_crypt implementation.
+# if the former, we can support anything supported by passlib.hosts.host_context,
+# allowing more secure hashes than apr_md5_crypt to be used.
+# could perhaps add this behavior as an option to the constructor.
+# c.f. http://httpd.apache.org/docs/2.2/programs/htpasswd.html
htpasswd_context = CryptContext([
"apr_md5_crypt", # man page notes supported everywhere, default on Windows, Netware, TPF
"des_crypt", # man page notes server does NOT support this on Windows, Netware, TPF
diff --git a/passlib/handlers/md5_crypt.py b/passlib/handlers/md5_crypt.py
index 6832dcf..ec8c773 100644
--- a/passlib/handlers/md5_crypt.py
+++ b/passlib/handlers/md5_crypt.py
@@ -237,6 +237,13 @@ class md5_crypt(uh.HasManyBackends, _MD5_Common):
If not specified, one will be autogenerated (this is recommended).
If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.
+ :type salt_size: int
+ :param salt_size:
+ Optional number of characters to use when autogenerating new salts.
+ Defaults to 8, but can be any value between 0 and 8.
+ (This is mainly needed when generating Cisco-compatible hashes,
+ which require ``salt_size=4``).
+
:type relaxed: bool
:param relaxed:
By default, providing an invalid value for one of the other