Cosmetics in htpasswd

This commit is contained in:
Guillaume Ayoub 2015-07-29 14:00:49 +02:00
parent 3b520a966b
commit b4438d25f7

View File

@ -49,6 +49,7 @@ following significantly more secure schemes are parsable by Radicale:
- MD5-APR1 (htpasswd -m...) -- htpasswd's default method - MD5-APR1 (htpasswd -m...) -- htpasswd's default method
- BCRYPT (htpasswd -B...) -- Requires htpasswd 2.4.x - BCRYPT (htpasswd -B...) -- Requires htpasswd 2.4.x
""" """
@ -111,8 +112,7 @@ def _md5apr1(hash_value, password):
_verifuncs = { _verifuncs = {
"ssha": _ssha, "ssha": _ssha,
"sha1": _sha1, "sha1": _sha1,
"plain": _plain "plain": _plain}
}
# Conditionally attempt to import external dependencies. # Conditionally attempt to import external dependencies.
@ -149,9 +149,12 @@ if ENCRYPTION not in _verifuncs:
def is_authenticated(user, password): def is_authenticated(user, password):
"""Validate credentials: iterate through htpasswd credential file until """Validate credentials.
user matches, extract hash (encrypted password) and check hash against
user-given password, using the method specified in the Radicale config. Iterate through htpasswd credential file until user matches, extract hash
(encrypted password) and check hash against user-given password, using the
method specified in the Radicale config.
""" """
with open(FILENAME) as f: with open(FILENAME) as f:
for line in f: for line in f: