diff options
author | Eli Collins <elic@assurancetechnologies.com> | 2011-04-25 12:50:51 -0400 |
---|---|---|
committer | Eli Collins <elic@assurancetechnologies.com> | 2011-04-25 12:50:51 -0400 |
commit | 69a50bb8166a6236e08b63c68f80b089ebcd38ce (patch) | |
tree | 3c82a1446db076319a63f8295d2321e34ee35a52 /passlib/handlers/pbkdf2.py | |
parent | 3134fdb5722eab2265e1d2f5bef1a24d3698809c (diff) | |
download | passlib-69a50bb8166a6236e08b63c68f80b089ebcd38ce.tar.gz |
api change - renaming (min|max|default)_salt_chars attributes -> (min|max|default)_salt_size
* part of finalization of password hash api, these should not change name again
* the names are rather ambiguous, "_size" makes it clearer what they mean
* also renamed salt_charset -> salt_chars for the same reason
* for applications that were reading old attributes, left aliases in place
which will issue a warning when access - these will be removed in passlib 1.5
*
Diffstat (limited to 'passlib/handlers/pbkdf2.py')
-rw-r--r-- | passlib/handlers/pbkdf2.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/passlib/handlers/pbkdf2.py b/passlib/handlers/pbkdf2.py index 8cf9b21..f4a76ed 100644 --- a/passlib/handlers/pbkdf2.py +++ b/passlib/handlers/pbkdf2.py @@ -35,9 +35,9 @@ class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gen setting_kwds = ("salt", "salt_size", "rounds") #--HasSalt-- - default_salt_chars = 16 - min_salt_chars = 0 - max_salt_chars = 1024 + default_salt_size = 16 + min_salt_size = 0 + max_salt_size = 1024 #--HasRounds-- default_rounds = 6400 @@ -48,7 +48,7 @@ class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gen #--this class-- _prf = None #subclass specified prf identifier - #NOTE: max_salt_chars and max_rounds are arbitrarily chosen to provide sanity check. + #NOTE: max_salt_size and max_rounds are arbitrarily chosen to provide sanity check. # the underlying pbkdf2 specifies no bounds for either. #NOTE: defaults chosen to be at least as large as pbkdf2 rfc recommends... @@ -118,7 +118,7 @@ def create_pbkdf2_hash(hash_name, digest_size): :param rounds: Optional number of rounds to use. Defaults to %(dr)d, but must be within ``range(1,1<<32)``. - """ % dict(prf=prf, dsc=base.default_salt_chars, dr=base.default_rounds) + """ % dict(prf=prf, dsc=base.default_salt_size, dr=base.default_rounds) )) #--------------------------------------------------------- @@ -160,13 +160,13 @@ class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): setting_kwds = ("salt", "salt_size", "rounds") ident = "$p5k2$" - #NOTE: max_salt_chars and max_rounds are arbitrarily chosen to provide sanity check. + #NOTE: max_salt_size and max_rounds are arbitrarily chosen to provide sanity check. # underlying algorithm (and reference implementation) allow effectively unbounded values for both of these. #--HasSalt-- - default_salt_chars = 16 - min_salt_chars = 0 - max_salt_chars = 1024 + default_salt_size = 16 + min_salt_size = 0 + max_salt_size = 1024 #--HasROunds-- default_rounds = 10000 @@ -247,7 +247,7 @@ class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler) _stub_checksum = "\x00" * 32 #--HasRawSalt-- - min_salt_chars = max_salt_chars = 16 + min_salt_size = max_salt_size = 16 @classmethod def from_string(cls, hash): @@ -301,13 +301,13 @@ class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gene ident = "grub.pbkdf2.sha512." - #NOTE: max_salt_chars and max_rounds are arbitrarily chosen to provide sanity check. + #NOTE: max_salt_size and max_rounds are arbitrarily chosen to provide sanity check. # the underlying pbkdf2 specifies no bounds for either, # and it's not clear what grub specifies. - default_salt_chars = 64 - min_salt_chars = 0 - max_salt_chars = 1024 + default_salt_size = 64 + min_salt_size = 0 + max_salt_size = 1024 default_rounds = 10000 min_rounds = 1 |