Merge pull request #30238 from rallytime/fix-28396

Reinit crypto before calling RSA.generate when generating keys.
This commit is contained in:
Mike Place 2016-01-13 11:22:11 -07:00
commit 5a8da62008

View File

@ -85,6 +85,7 @@ def gen_keys(keydir, keyname, keysize, user=None):
priv = '{0}.pem'.format(base)
pub = '{0}.pub'.format(base)
salt.utils.reinit_crypto()
gen = RSA.generate(bits=keysize, e=65537)
if os.path.isfile(priv):
# Between first checking and the generation another process has made