summaryrefslogtreecommitdiff
path: root/passlib/handlers/pbkdf2.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-03-09 18:45:34 -0500
committerEli Collins <elic@assurancetechnologies.com>2012-03-09 18:45:34 -0500
commit72ec6bedc4fdad8845b39788430f32345234ca67 (patch)
treecfd206065093a58646f6b4bef9415804b6c0d96a /passlib/handlers/pbkdf2.py
parente0803178ae49f1fbaa367a7564b9877eacce628e (diff)
downloadpasslib-72ec6bedc4fdad8845b39788430f32345234ca67.tar.gz
utils.handlers framework reworked; removed a bunch of boilerplate code
* StaticHandler is now subclass of GenericHandler - _calc_checksum() should be implemented instead of encrypt(). (compatibility stub added so old code should continue to work) - _norm_hash() no longer needs to handle ->unicode conversion - default from_string() contains a bunch of features, including stripping a known prefix, etc. * context kwds now pulled into constructor, so GenericHandler supports context kwds properly; HasUserContext mixin added to support common 'user' context kwd * identify_regexp & identify_prefix removed, functionality rolled into default GenericHandler.identify() implementation. - default identify checks _hash_regex as potential way to identify hashes * HasStubChecksum removed, functionality rolled into GenericHandler * HasRawChecksum now just sets a flag, functionality moved into GenericHandler * HasManyIdents._parse_ident() helper added to valid & split identifier from hashes. * GenericHandler._norm_checksum() is now strict about unicode / bytes
Diffstat (limited to 'passlib/handlers/pbkdf2.py')
-rw-r--r--passlib/handlers/pbkdf2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/passlib/handlers/pbkdf2.py b/passlib/handlers/pbkdf2.py
index 37dab77..477e09d 100644
--- a/passlib/handlers/pbkdf2.py
+++ b/passlib/handlers/pbkdf2.py
@@ -184,7 +184,7 @@ class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Generic
#--HasROunds--
default_rounds = 10000
- min_rounds = 0
+ min_rounds = 1
max_rounds = 2**32-1
rounds_cost = "linear"
@@ -281,7 +281,7 @@ class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler):
#--HasROunds--
default_rounds = 10000
- min_rounds = 0
+ min_rounds = 1
max_rounds = 2**32-1
rounds_cost = "linear"
@@ -336,7 +336,7 @@ class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler):
#=========================================================
#crowd
#=========================================================
-class atlassian_pbkdf2_sha1(uh.HasStubChecksum, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
+class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
"""This class implements the PBKDF2 hash used by Atlassian.
It supports a fixed-length salt, and a fixed number of rounds.