[fix] use cryptorandom to generate password

This commit is contained in:
Laurent Peuch 2017-08-27 05:42:33 +02:00
parent 32d3a9940b
commit c6b5284be8

View file

@ -2104,4 +2104,4 @@ def random_password(length=8):
import random
char_set = string.ascii_uppercase + string.digits + string.ascii_lowercase
return ''.join(random.sample(char_set, length))
return ''.join([random.SystemRandom().choice(char_set) for x in range(length)])