Ensure serial number conforms to OpenSSL's even-number-of-digits requirement.

This commit is contained in:
Josh Matthews 2016-06-27 16:39:37 -04:00
parent 887376b225
commit cf073f1f0b

View file

@ -252,7 +252,10 @@ class OpenSSLEnvironment(object):
with open(path("index.txt"), "w"):
pass
with open(path("serial"), "w") as f:
f.write(str(random.randint(0, 1000000)))
serial = str(random.randint(0, 1000000))
if len(serial) % 2:
serial = "0" + serial
f.write(serial)
self.path = path