Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cert module fixes #55

Merged
merged 2 commits into from
Sep 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions base/server/python/pki/server/cli/cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ def execute(self, argv):
create_temp_cert = True

elif o == '--serial':
serial = a
# string containing the dec or hex value for the identifier
serial = str(int(a, 0))

elif o == '--output':
output = a
Expand Down Expand Up @@ -1009,6 +1010,13 @@ def execute(self, argv):
subsystem_name, instance_name)
sys.exit(1)

# audit and CA certs require special flags set in NSSDB
trust_attributes = None
if cert_id == 'ca_signing':
trust_attributes = 'CT,C,C'
elif cert_tag == 'audit_signing':
trust_attributes = ',,P'

nssdb = instance.open_nssdb()

try:
Expand Down Expand Up @@ -1036,7 +1044,8 @@ def execute(self, argv):
nssdb.add_cert(
nickname=cert['nickname'],
token=cert['token'],
cert_file=cert_file)
cert_file=cert_file,
trust_attributes=trust_attributes)

logger.info('Updating CS.cfg with the new certificate')

Expand Down