From daed17fac83c206575478b04228835a5705f421f Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 13 Jul 2021 10:44:58 -0400 Subject: [PATCH] exclude null character, max out passwd length on random --- src/gam/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 5fb1b53c..d41d6d7a 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -7132,10 +7132,10 @@ def getUserAttributes(i, cd, updateCmd): # passwords. We expect "password random nohash" to fail but no one # should be using that. Our goal here is to purposefully block login # with this password. - pass_chars = [chr(i) for i in range(55296)] + pass_chars = [chr(i) for i in range(1, 55296)] rnd = SystemRandom() body['password'] = ''.join( - rnd.choice(pass_chars) for _ in range(2000)) + rnd.choice(pass_chars) for _ in range(4096)) if 'password' in body and need_to_hash_password: body['password'] = gen_sha512_hash(body['password']) body['hashFunction'] = 'crypt'