summaryrefslogtreecommitdiff
path: root/addons/auth_crypt/auth_crypt.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/auth_crypt/auth_crypt.py')
-rw-r--r--addons/auth_crypt/auth_crypt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/auth_crypt/auth_crypt.py b/addons/auth_crypt/auth_crypt.py
index 9724b511a05..3aac70c1a59 100644
--- a/addons/auth_crypt/auth_crypt.py
+++ b/addons/auth_crypt/auth_crypt.py
@@ -11,7 +11,7 @@
import hashlib
import hmac
import logging
-from random import sample
+import random
from string import ascii_letters, digits
import openerp
@@ -28,7 +28,7 @@ res_users.USER_PRIVATE_FIELDS.append('password_crypt')
def gen_salt(length=8, symbols=None):
if symbols is None:
symbols = ascii_letters + digits
- return ''.join(sample(symbols, length))
+ return ''.join(random.SystemRandom().sample(symbols, length))
def md5crypt( raw_pw, salt, magic=magic_md5 ):
""" md5crypt FreeBSD crypt(3) based on but different from md5