Address more comments from @cachedout

This commit is contained in:
Joseph Hall 2017-03-22 11:53:11 -06:00
parent f7c6c66ac6
commit a54d005dfd

View File

@ -130,6 +130,9 @@ def gen_key(minion_id, dns_name=None, zone='default', password=None):
keygen_type = keyTypes[0]['keyType']
key_len = keyTypes[0]['keyLengths'][0]
if key_len < 2048:
key_len = 2048
if keygen_type == "RSA":
gen = RSA.generate(bits=key_len)
private_key = gen.exportKey('PEM', password)