Don't generate insecure passwords where it's easy to use urandom instead
This commit is contained in:
@@ -69,7 +69,7 @@ class ConsoleProxyManager(manager.Manager):
|
||||
except exception.NotFound:
|
||||
logging.debug(_("Adding console"))
|
||||
if not password:
|
||||
password = self.driver.generate_password()
|
||||
password = utils.generate_password(8)
|
||||
if not port:
|
||||
port = self.driver.get_port(context)
|
||||
console_data = {'instance_name': name,
|
||||
|
||||
@@ -91,10 +91,6 @@ class XVPConsoleProxy(object):
|
||||
"""Trim password to length, and encode"""
|
||||
return self._xvp_encrypt(password)
|
||||
|
||||
def generate_password(self, length=8):
|
||||
"""Returns random console password"""
|
||||
return os.urandom(length * 2).encode('base64')[:length]
|
||||
|
||||
def _rebuild_xvp_conf(self, context):
|
||||
logging.debug(_("Rebuilding xvp conf"))
|
||||
pools = [pool for pool in
|
||||
|
||||
Reference in New Issue
Block a user