Commit 6cd2e8a1 authored by Łukasz Nowak's avatar Łukasz Nowak

Fix matching.

CN is expressed as:

CN=name/email

And thanks to matching to CN/ it is possible to manage certificates like
user and useroink.
parent 8c255d79
......@@ -265,7 +265,7 @@ class CertificateAuthorityTool(BaseTool):
def _getValidSerial(self, common_name):
index = open(self.index).read().splitlines()
valid_line_list = [q for q in index if q.startswith('V') and
('CN=%s' % common_name in q)]
('CN=%s/' % common_name in q)]
if len(valid_line_list) != 1:
raise ValueError('No certificate for %r' % common_name)
return valid_line_list[0].split('\t')[3]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment