summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sign_csr.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sign_csr.py b/sign_csr.py
index 643fbb0..28b5257 100644
--- a/sign_csr.py
+++ b/sign_csr.py
@@ -36,7 +36,9 @@ def sign_csr(pubkey, csr, email=None):
out, err = proc.communicate()
if proc.returncode != 0:
raise IOError("Error loading {}".format(pubkey))
- pub_hex, pub_exp = re.search("Modulus\:\s+00:([a-f0-9\:\s]+?)Exponent\: ([0-9]+)", out, re.MULTILINE|re.DOTALL).groups()
+ pub_hex, pub_exp = re.search(
+ "Modulus(?: \((?:2048|4096) bit\)|)\:\s+00:([a-f0-9\:\s]+?)Exponent\: ([0-9]+)",
+ out, re.MULTILINE|re.DOTALL).groups()
pub_mod = binascii.unhexlify(re.sub("(\s|:)", "", pub_hex))
pub_mod64 = _b64(pub_mod)
pub_exp = int(pub_exp)