From 9b78833e0084ff5b5d94c0d4b0a46962a066dd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com> Date: Tue, 18 Jan 2011 10:41:43 +0000 Subject: [PATCH] - do not mangle id to CN, as it shall be used in it clean, lowercased form git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42408 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/Vifib/Tool/CertificateAuthorityTool.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/product/Vifib/Tool/CertificateAuthorityTool.py b/product/Vifib/Tool/CertificateAuthorityTool.py index 8bcd7ee887..47f0e42642 100644 --- a/product/Vifib/Tool/CertificateAuthorityTool.py +++ b/product/Vifib/Tool/CertificateAuthorityTool.py @@ -36,7 +36,6 @@ from zLOG import LOG, INFO import os import subprocess -import base64 def popenCommunicate(command_list, input=None, **kwargs): kwargs.update(stdout=subprocess.PIPE, stderr=subprocess.STDOUT) @@ -185,14 +184,13 @@ class CertificateAuthorityTool(BaseTool): self._lockCertificateAuthority() try: new_id = open(self.serial, 'r').read().strip().lower() - cn = base64.encodestring(str(new_id) + ':') key = os.path.join(self.certificate_authority_path, 'private', new_id+'.key') csr = os.path.join(self.certificate_authority_path, new_id + '.csr') cert = os.path.join(self.certificate_authority_path, 'certs', new_id + '.crt') try: popenCommunicate([self.openssl_binary, 'req', '-nodes', '-config', self.openssl_config, '-new', '-keyout', key, '-out', csr, '-days', - '3650'], '%s\n' % cn, stdin=subprocess.PIPE) + '3650'], '%s\n' % new_id, stdin=subprocess.PIPE) popenCommunicate([self.openssl_binary, 'ca', '-batch', '-config', self.openssl_config, '-out', cert, '-infiles', csr]) os.unlink(csr) -- 2.30.9