diff options
author | Eli Collins <elic@assurancetechnologies.com> | 2012-03-12 21:33:28 -0400 |
---|---|---|
committer | Eli Collins <elic@assurancetechnologies.com> | 2012-03-12 21:33:28 -0400 |
commit | 3913a59ad033462e6a389544ffcdf8055db7ad9c (patch) | |
tree | 63dda089e61a9d8ef4b468a323df8c2ec2ad6c70 /passlib/handlers/des_crypt.py | |
parent | b970d6ee145122005f1e6808466900a94e00dfcc (diff) | |
download | passlib-3913a59ad033462e6a389544ffcdf8055db7ad9c.tar.gz |
updated test support & py3 compat code from an external library
passlib.tests
-------------
* deprecated support for unittest 1... accumulated too many backports,
planning to require unittest2 in next release.
* case_prefix renamed to shortDescription
* test case now archives & clears warning registry state in addition
to warning filter state
passlib.utils.compat
--------------------
* a bunch of the bytes-related functions were renamed for clarity
* NativeStringIO alias added
* trange alias merged into irange
Diffstat (limited to 'passlib/handlers/des_crypt.py')
-rw-r--r-- | passlib/handlers/des_crypt.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/passlib/handlers/des_crypt.py b/passlib/handlers/des_crypt.py index 5e3cb4c..f663a39 100644 --- a/passlib/handlers/des_crypt.py +++ b/passlib/handlers/des_crypt.py @@ -59,7 +59,7 @@ from warnings import warn #site #libs from passlib.utils import classproperty, h64, h64big, safe_crypt, test_crypt -from passlib.utils.compat import b, bytes, belem_ord, u, uascii_to_str, unicode +from passlib.utils.compat import b, bytes, byte_elem_value, u, uascii_to_str, unicode from passlib.utils.des import mdes_encrypt_int_block import passlib.utils.handlers as uh #pkg @@ -77,7 +77,7 @@ __all__ = [ def _crypt_secret_to_key(secret): "crypt helper which converts lower 7 bits of first 8 chars of secret -> 56-bit des key, padded to 64 bits" return sum( - (belem_ord(c) & 0x7f) << (57-8*i) + (byte_elem_value(c) & 0x7f) << (57-8*i) for i, c in enumerate(secret[:8]) ) |