djeraseit / passlib

Automatically exported from code.google.com/p/passlib
Other
0 stars 0 forks source link

verify exceeded min_verify_time - only on osx #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. from passlib.apps import custom_app_context as pwd_context
2. hash = pwd_context.encrypt("somepass")
3. ok = pwd_context.verify("somepass", hash)

What is the expected output? What do you see instead?
Expect ok to be true. Instead, I get the following exception
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "passlib/context.py", line 1085, in verify
    warn("CryptContext: verify exceeded min_verify_time: scheme=%r min_verify_time=%r elapsed=%r", handler.name, mvt, end-start)
TypeError: warn() takes at most 3 arguments (4 given)

I am using passlib 1.5 on Max OSX 10.6 (snow leopard). If I open a linux vm on 
the same machine and run the same steps, the exception isn't thrown and 
everything works fine. 

Original issue reported on code.google.com by vika...@gmail.com on 9 Aug 2011 at 10:36

GoogleCodeExporter commented 9 years ago
Thanks for reporting this, looks like two bugs in one.

I've committed fixes to the mercurial repo, but probably won't have time to 
push a new release for a little while. If this is a showstopper for you, you 
can use the following snippet in place of importing custom_app_context...

{{{
from passlib.context import CryptContext
pwd_context = CryptContext(
    schemes=["sha512_crypt", "sha256_crypt"],
    all__vary_rounds = "10%",
    sha512_crypt__default_rounds = 40000,
    sha256_crypt__default_rounds = 40000,
    admin__sha512_crypt__default_rounds = 80000,
    admin__sha256_crypt__default_rounds = 80000,
    )
}}}

Original comment by elic@astllc.org on 11 Aug 2011 at 1:52

GoogleCodeExporter commented 9 years ago

Original comment by elic@astllc.org on 11 Aug 2011 at 2:14

GoogleCodeExporter commented 9 years ago
Great, thanks!

Original comment by vika...@gmail.com on 11 Aug 2011 at 5:31

GoogleCodeExporter commented 9 years ago
1.5.1 has been released, which fixes this bug.

Original comment by elic@astllc.org on 17 Aug 2011 at 4:47