From cf073f1f0b519bc2cfb508dfa9bc42315ef95bb4 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 27 Jun 2016 16:39:37 -0400 Subject: [PATCH] Ensure serial number conforms to OpenSSL's even-number-of-digits requirement. --- tests/wpt/web-platform-tests/tools/sslutils/openssl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/wpt/web-platform-tests/tools/sslutils/openssl.py b/tests/wpt/web-platform-tests/tools/sslutils/openssl.py index 2bbc0fa7545..754bc946c7e 100644 --- a/tests/wpt/web-platform-tests/tools/sslutils/openssl.py +++ b/tests/wpt/web-platform-tests/tools/sslutils/openssl.py @@ -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