summaryrefslogtreecommitdiff
path: root/passlib/tests/test_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* work on des_crypt familyEli Collins2012-04-131-424/+0
| | | | | * cleaned up source of des_crypt variants and DES util functions * DES utils functions now have tighter input validation, full UT coverage
* assorted bugfixes, tweaks, and tests added; based on coverage examinationEli Collins2012-04-121-0/+82
| | | | | | | * test os_crypt backend has functional fallback * test handler methods accept all unicode/bytes combinations for secret & hash * fixed some incorrect error messages & types being caught & raised * other minor cleanups
* ran full UTs, found and fixed a few bugs introduced in last few commits.Eli Collins2012-04-111-3/+2
|
* updated test support & py3 compat code from an external libraryEli Collins2012-03-121-10/+10
| | | | | | | | | | | | | | | | 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
* added hack to clear warnings registry so assertWarningList() tests will pass ↵Eli Collins2012-03-111-3/+3
| | | | reliably
* to_bytes, to_unicode, to_native_str: added special TypeErrors for None, ↵Eli Collins2012-03-101-1/+1
| | | | other small tweaks
* safe_crypt() now handles "*0" and similar error returns from crypt()Eli Collins2012-03-101-6/+10
|
* various bcrypt improvementsEli Collins2012-03-101-0/+32
| | | | | | | | | | | | * studied crypt_blowfish's 8bit bug - verified none of passlib's backends were affected - added recognition (but not support) for crypt_blowfish's $2x$ hash prefix - added support for crypt_blowfish's $2y$ hash prefix - note in docs about Passlib's current handling of crypt_blowfish 8bit issues. * refactored bcrypt's salt-unused-bits repair code into Base64Engine.repair_unused(), making the code cleaner and more isolated. a bunch more tests. * added bcrypt64 (bcrypt-base64 variant) to utils * added LazyBase64Engine to reduce memory / startup time
* cleanup of scram hash; improved norm_digest_name() and moved it to utils.pbkdf2Eli Collins2012-03-101-0/+44
|
* simplified crypt.crypt() wrappersEli Collins2012-01-191-44/+48
| | | | | | | * safe_crypt() improved - accepts unicode/bytes for salt, checks for NULL, returns None on failure * added test_crypt() wrapper to simplify backend checks. * removed native=True from most to_string() implementations, unused now. * updated UTs
* misc bugfixes from round of changesEli Collins2012-01-181-15/+15
| | | | | | | | | * added str_to_[ub]ascii to wrap hexdigest() calls * fixed some h64big calls I missed * some py3 fixes * removed utils.compat.aliases, using overlay to replace real compat module instead (to agree w/ imports already in code)
* import cleanupsEli Collins2012-01-181-21/+23
| | | | | | | | | | | | | | | * moved bytes compat functions from utils to utils.compat (bord, bjoin, bjoin_ints, bjoin_elems, ujoin) * renamed bord -> belem_ord for clarify * a bunch of to_native_str() always use ascii, and have fixed input types (always bytes or always unicode). these don't need overhead of to_native_str(), so replaced those calls with two new funcs: compat.bascii_to_str() / compat.uascii_to_str() * cleaned up a lot of imports from utils/utils.compat to pull from correct module * simplified the to_string() logic of a bunch of handlers to reduce unicode<->byte transitions
* changed test_utils to import subjects within test functions, instead of globallyEli Collins2012-01-181-22/+34
|
* replaced utils.h64 module with utils.Base64Engine instanceEli Collins2012-01-181-89/+298
| | | | | | | | | | | * new utils.Base64Engine() provides flexible class for encoding arbitrary base64 charmaps. it should also be a bit faster than the old h64 module. * predefined 'h64' instance has mostly the same methods as the old h64 module which it takes the place off - so imports should be unaffected. (the only the exception of the xxx_dc_xxx methods, which now use the 'h64big' instance) * replaced utils._blowfish base64 encoding with custom Base64Engine instance to reduce code duplication. * more through unittests for Base64Engine.
* lots of work on scram hashEli Collins2012-01-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | handler ------- * added 'scram' to default registry list * handler 'algs' keyword now parsed & validated correctly * digest names normalized -> IANA spec * saslprep() integrated into code * added config string format related ------- * added documentation (still needs cleaning up though) * added majority of UTs, still need to add a few edge cases other ----- * redid context->handler deprecation link - code now looks for handler._deprecated_detector(settings) to generate a callable, should be more efficient, and allow errors to be throw at bind-time instead of call-time. * pbkdf2() function now treats keylen = -1 as request for keylen = PRF digest size.
* minor fixesEli Collins2012-01-091-2/+3
|
* removed Undef singleton, private _NOTSET singletons are cleaner.Eli Collins2011-12-281-11/+1
|
* deprecated to_hash_str, replaced all instances with to_native_strEli Collins2011-12-281-15/+22
| | | | | | decided that to_hash_str will always return native string, feature of hashes being returned as unicode under python 2 is better done through a CryptContext option.
* misc fixes for py3 compatEli Collins2011-12-281-36/+36
|
* Merge from defaultEli Collins2011-12-281-0/+86
|\
| * issue 24: added saslprep() function to support SASL stringprep profile; ↵Eli Collins2011-12-131-0/+76
| | | | | | | | still have to work it into Context object
| * was browsing Python's source, and noticed crypt() might sometimes return None --Eli Collins2011-12-091-0/+10
| |
* | couple of minor tweaks - basic unittests pass 2.7 & 3.2Eli Collins2011-12-061-2/+2
| |
* | replaced all #Py3k# conditional includesEli Collins2011-12-061-38/+27
| |
* | ran a custom 2to3 fixer to replace all u"" with u() and add an import from ↵Eli Collins2011-12-061-58/+59
| | | | | | | | compat.u
* | added compat.unicode imports in a number of placesEli Collins2011-12-061-0/+1
| | | | | | | | | | | | | | | | this distinguishes the types, so that for isinstance() tests... * 'unicode' always means the unicode type * 'bytes' always means the bytes type * 'str' always means the native string type
* | moved sys_bits to compat, added exc_err, removed utils.py32_langEli Collins2011-12-061-1/+1
| |
* | replaced xrange() instances with compat.irange() aliasEli Collins2011-12-061-1/+1
| |
* | added compatibility module (passlib.utils.compat)Eli Collins2011-12-061-1/+1
|/ | | | | | | | | exports specialized range & map aliases, and some dict helpers * all dict.iteritems() calls replaced with compat.iteritems(dict) * all xrange() calls replaced with compat.irange() * all range() calls replaced with compat.trange() and compat.lrange() as appropriate * all map() calls replaced with compat.lmap()
* all verify() methods now use "constant time" comparison function (see ↵Eli Collins2011-12-011-1/+85
| | | | CHANGELOG for details)
* replaced assert_, assertEquals, assertNotEquals to silence Py3.2 deprecation ↵Eli Collins2011-07-111-6/+6
| | | | warnings
* added test for builtin MD4 class even if SSL version present, for coverageEli Collins2011-07-111-7/+30
|
* bugfixes from running UTsEli Collins2011-07-091-1/+1
| | | | | | | | | | | | | * typo in safe_os_crypt UT * typo in has_backend UT * typo in HasManyBackends HandlerCase UT * fixed inverted has_backend() test in HasManyBackends.set_backend() * ensure all safe_os_crypt backend checks return boolean * BSDiCrypt - fixed os_crypt backend, was passing incomplete string to os_crypt * workaround for Jython object.__new__() behavior in test 'UnsaltedHash' UT * added passlib.utils.jython_vm flag for detecting jython
* stripped trailing whitespace from a bunch of filesEli Collins2011-07-081-32/+32
|
* redid multi-backend tests to have separate test named for each backend, and ↵Eli Collins2011-06-221-8/+7
| | | | use UT2 class-level SkipTest if available
* redid test.utils to make use of unittest2 features if availableEli Collins2011-06-221-2/+2
| | | | | * also reworked some parallel features to operate in a UT2 compatible way * still rely on nose for discovery purposes.
* added UT for safe_os_crypt(), helper method is_ascii_safe()Eli Collins2011-06-201-2/+50
|
* rest of utils now py3 compatEli Collins2011-06-171-71/+212
| | | | | | | * kdfs, md4, and utils proper * updated UTs * added to_native_str helper * added some UTs for new to_bytes / to_unicode etc methods
* utils.des now py3 compat; fixed some other utils as wellEli Collins2011-06-171-3/+3
|
* utils.h64 now py3 compatibleEli Collins2011-06-171-34/+43
| | | | | | | * rewrote internals a bit * added some more utils helpers to deal w/ bytes elements beings ints, not just bytes-slices * added 'bytes' type checks to most h64 funcs * updated H64 UTs till they pass
* misc cleanupsEli Collins2011-06-021-79/+0
|
* kdf enhancementsEli Collins2011-06-021-0/+24
| | | | | | | * renamed _resolve_prf() to get_prf(), documented interface * added pbkdf1 support * added 'encoding' kwd to pbkdf1 & pbkdf2, for easier handling of unicode inputs *
* added rfc6070 pbkdf2 test vectors for completenessEli Collins2011-04-251-0/+39
|
* added a generate_password() convenience methodEli Collins2011-03-291-0/+3
|
* deprecated list_to_bytes & bytes_to_list - not needed since bcrypt fallback ↵Eli Collins2011-03-291-70/+78
| | | | removed
* misc bugfixes & tweaks for win32 compatEli Collins2011-03-251-2/+5
|
* removed pure-python bcrypt implementation, wasn't fast enough to be usuable, ↵Eli Collins2011-03-241-33/+0
| | | | and probably never will be.
* split passlib.base into passlib.registry & passlib.context - the two have ↵Eli Collins2011-03-221-1/+1
| | | | little to do with eachother
* cleaned up registry code, added more UTs.Eli Collins2011-03-211-1/+12
|
* bugfixes, tweaks, test casesEli Collins2011-03-181-32/+147
| | | | | | | | | | | | | | | | | ============================ * now at 99% coverage * changed some error types * bugfix to min_verify_time code * tests for registry, some cryptcontext border cases * ldap hash tests * tests for rest of utils * tests for skeleton hash classes in passlib.utils.drivers * moved validate_class code from skeleton hash classes to HandlerCase main things still needing testing: * category support for CryptContext/Policy * some bits of registry