diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-17 11:03:41 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-24 16:52:49 -0700 |
commit | 14efa7bdf19cf4042fe6455c0f9516f5b2d91a0c (patch) | |
tree | 773e297dc322bfdf9b4212ce8457d9dcfe651392 /mediagoblin/auth/lib.py | |
parent | c9dec8b3cc2c2db306256d9eb12cdd44bf96a56c (diff) | |
download | mediagoblin-14efa7bdf19cf4042fe6455c0f9516f5b2d91a0c.tar.lz mediagoblin-14efa7bdf19cf4042fe6455c0f9516f5b2d91a0c.tar.xz mediagoblin-14efa7bdf19cf4042fe6455c0f9516f5b2d91a0c.zip |
moved fake_login_attempt to plugins
Diffstat (limited to 'mediagoblin/auth/lib.py')
-rw-r--r-- | mediagoblin/auth/lib.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/mediagoblin/auth/lib.py b/mediagoblin/auth/lib.py index 45d0a63f..6f5340dd 100644 --- a/mediagoblin/auth/lib.py +++ b/mediagoblin/auth/lib.py @@ -13,35 +13,11 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - -import random - -import bcrypt - from mediagoblin.tools.mail import send_email from mediagoblin.tools.template import render_template from mediagoblin import mg_globals -def fake_login_attempt(): - """ - Pretend we're trying to login. - - Nothing actually happens here, we're just trying to take up some - time, approximately the same amount of time as - bcrypt_check_password, so as to avoid figuring out what users are - on the system by intentionally faking logins a bunch of times. - """ - rand_salt = bcrypt.gensalt(5) - - hashed_pass = bcrypt.hashpw(str(random.random()), rand_salt) - - randplus_stored_hash = bcrypt.hashpw(str(random.random()), rand_salt) - randplus_hashed_pass = bcrypt.hashpw(hashed_pass, rand_salt) - - randplus_stored_hash == randplus_hashed_pass - - EMAIL_VERIFICATION_TEMPLATE = ( u"http://{host}{uri}?" u"userid={userid}&token={verification_key}") |