From c034463e2c8f9f004083d8d5474896d07975b17b Mon Sep 17 00:00:00 2001 From: Marco Fargetta Date: Mon, 2 Oct 2023 16:43:23 +0200 Subject: [PATCH] pki-server system certificate from nssdb System certificates are stored in CS.cfg and nssdb. This is redundant, all operations should use the same source for the certificate which is the nssdb. This modify the following command in order to get the certificate from nssdb: [root@pki /] # pki-server cert-export --cert-file --- base/common/python/pki/nssdb.py | 2 ++ base/server/python/pki/server/subsystem.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/base/common/python/pki/nssdb.py b/base/common/python/pki/nssdb.py index 8da32e78094..0c3e93fb6c4 100644 --- a/base/common/python/pki/nssdb.py +++ b/base/common/python/pki/nssdb.py @@ -2009,6 +2009,8 @@ def get_cert_info(self, nickname, token=None): cert = {} cert['object'] = cert_obj + cert['data'] = self.get_cert(nickname=nickname, token=token, output_format='base64') + cert['serial_number'] = cert_obj.serial_number cert['issuer'] = pki.convert_x509_name_to_dn(cert_obj.issuer) diff --git a/base/server/python/pki/server/subsystem.py b/base/server/python/pki/server/subsystem.py index d2ff3af4cc6..235aa602668 100644 --- a/base/server/python/pki/server/subsystem.py +++ b/base/server/python/pki/server/subsystem.py @@ -306,7 +306,6 @@ def get_cert_info(self, tag): cert['id'] = tag cert['nickname'] = self.config.get('%s.%s.nickname' % (self.name, tag)) cert['token'] = self.config.get('%s.%s.tokenname' % (self.name, tag)) - cert['data'] = self.config.get('%s.%s.cert' % (self.name, tag)) cert['request'] = self.config.get('%s.%s.certreq' % (self.name, tag)) cert['certusage'] = self.config.get('%s.cert.%s.certusage' % (self.name, tag))