5Xc@sdZddlmZddlZejeZddlZddlZddl m Z ddl m Z m Z ddlmZmZddlmZddlmZmZdd lmZd efd YZejd Zejd ZejdZejdZejdZdefdYZejd Z ejd Z!ejdZ"ejdZ#ejdZ$dS(s?passlib.tests.test_handlers - tests for passlib hash algorithmsi(twith_statementN(thash(tIDENT_2tIDENT_2X(t repeat_stringtto_bytes(tirange(t HandlerCaset TEST_MODE(t UPASS_TABLEt _bcrypt_testcBseZdZejZeZeZe Z d^d_d`dadbdcdddedfdgdhdidjddddfddd fd!d"d#fdkd%d&d' d(fd%d&d) d(fd%d&d* d(fd%d&d+ d(fdldmdndodpe d5fe d6fgZ e d7rd8d9d:Zd;d9d:Ze jd ed<fd ed<fd/ed=fd/ed>fd/d?ed=fd/d?ed@fd/d"ed=fd/d"ed=fd/d"dAed=fd/d"dAed=fg ndBe dCfgZdDdEgZdFdGdHgZdIefdJe fgZdKZdLZdMZejdqZdQZdRZdSZdTejfdUYZdrdsdtgZd\Zd]Z RS(usbase for BCrypt test casessU*U*U*U*s<$2a$05$c92SVSfjeiCD6F2nAD6y0uBpJDjdRkt0EgeC4/31Rf2LUZbDRDE.OsU*U***Us<$2a$05$WY62Xk2TXZ7EvVDQ5fmjNu7b0GEzSzUXUh2cllxJwhtOeMtWV3UjqsU*U***U*s<$2a$05$Fa0iKV3E2SYVUlMknirWU.CFYGvJ67UwVKI1E2FP6XeLiZGcH3MJis*U*U*U*Us<$2a$05$.WRrXibc1zPgIdRXYfv.4uu6TD1KWf0VnHzq/0imhUhuxSxCyeBs2ts<$2a$05$Otz9agnajgrAe0.kFVF9V.tzaStZ2s1s4ZWi/LY4sw2k/MTVFj/IOsU*Us<$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeWsU*U*s<$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwKsU*U*Us<$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4as<$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNysb0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789chars after 72 are ignoreds<$2a$05$abcdefghijklmnopqrstuu5s2v8.iXieOjg/.AySBTTZIIVFJeBuiss<$2a$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCqs345s<$2a$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9esabs<$2a$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSISsiHs#chars after 72 are ignored as usuals<$2a$05$/OK.fbVrR/bpIqNJ5ianF.swQOIzjOiJ9GHEPuhEkvqrUyvWhEMx6sUi$s<$2a$05$/OK.fbVrR/bpIqNJ5ianF.R9xrDjiycxMbQE2bp.vgqlYpW5wx2yysUis<$2a$05$/OK.fbVrR/bpIqNJ5ianF.9tQZzcJfm3uj2NvJ/n5xkhpqLrMpWCes<$2y$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCqt 0123456789iis<$2a$04$R1lJ2gkNaoPGdafE.H.16.1MKHPvmKwryeulRe225LKProWYwt9Oiiiis<$2a$06$DCq7YPn5Rq63x1Lad4cll.TV4S6ytwfsfvkgY8jIucDrjc8deX1s.tas<$2a$10$k87L/MF28Q673VKh8/cPi.SUl7MU/rWuSiIDDFayrKk/1tBsSQu4utabcs<$2a$10$WvvTPHKwdBJ3uk0Z37EMR.hLA2W6N9AEBhEgrAOljy2Ae5MtaSIUitabcdefghijklmnopqrstuvwxyzs<$2a$10$fVH8e28OQRj9tqiDXs1e1uxpsjN0c7II7YPKXua2NAKYvM6iQk7dqs"~!@#$%^&*() ~!@#$%^&*()PNBFRDs<$2a$10$LgfYWkbzEvQ4JakH7rOvHe0y8pHKF9OaFgwUZ2q7W2FFZmZzJYlfSs<$2a$05$Z17AXnnlpzddNUvnC6cZNOSwMA/8oNiKnHTHTwLlBijfucQQlHjaGs<$2b$05$Z17AXnnlpzddNUvnC6cZNOSwMA/8oNiKnHTHTwLlBijfucQQlHjaGtfulls$2$05$t.is$2a$05$tJ2ihDv8vVf7QZ9BsaRrKyqs2tkn55YqsXuQjdH.wPVNUZ/bOfstdW/FqB8QSjtetev6gDwpVye3oMCUpLY85aTpfBNHD0Gais2kIdfSj/4/R/Q6n847VTvc68BXiRYZCtxs$2a$04$uM6csdM8R9SXTex/gbTayes<$2a$04$uM6csdM8R9SXTex/gbTayezuvzFEufYGd2uB6of7qScLjQ4GwcD4Gs<$2f$12$EXRkfkdmXnagzds2SSitu.MW9.gAVqa9eLS1//RYtYCmB1eLHg.9qs<$2`$12$EXRkfkdmXnagzds2SSitu.MW9.gAVqa9eLS1//RYtYCmB1eLHg.9qs<$2a$12$EXRkfkdmXn!gzds2SSitu.MW9.gAVqa9eLS1//RYtYCmB1eLHg.9qs<$2x$12$EXRkfkdmXnagzds2SSitu.MW9.gAVqa9eLS1//RYtYCmB1eLHg.9qs;$2a$6$DCq7YPn5Rq63x1Lad4cll.TV4S6ytwfsfvkgY8jIucDrjc8deX1s.sfreedbsd|openbsd|netbsdtdarwincCstdr{|jdkr{d}tjj|}|rU|jtjj||n|jtjj|dtj|tlenR3R@RA(RBR(R9R:R-t bcrypt_modtlockR%R<(sF/usr/lib/python2.7/site-packages/passlib/tests/test_handlers_bcrypt.pytcheck_pybcrypts  ( R0RR9R:RR-RER1R<t_load_backend_mixintFalseRGt _calc_lock(R%RRREtloadedRK((R9R:R-RIRJR%R<sF/usr/lib/python2.7/site-packages/passlib/tests/test_handlers_bcrypt.pyR7s. !csddlmmmmddlmyddlmWnt k rZdSXfd}|S(Ni(RR9R-R:(R<(tEnginecs|jj}|jfr;|d}n8|jrs|d}|rst|d}qsntj|||kS(tbcryptoriiiH(R=R>R3RRMthash_key(RBR(RPRR9R:R-R%R<(sF/usr/lib/python2.7/site-packages/passlib/tests/test_handlers_bcrypt.pytcheck_bcryptors( R0RR9R-R:R1R<tbcryptor.engineRPRD(R%RS((RPRR9R:R-R%R<sF/usr/lib/python2.7/site-packages/passlib/tests/test_handlers_bcrypt.pyR8 s" ! R=cBseZdZdZRS(cCsttj|j}|d}|d}|d}|jd}|tkr[|d=n\|tkr|rtt|t t|t|kr|j \|d<|ds0   o