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

Fix #50680 X509 - renewal check - short subject title not match #50734

Merged
merged 3 commits into from
Dec 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions salt/states/x509.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,12 @@ def certificate_managed(name,
raise salt.exceptions.SaltInvocationError(
'signing_policy must be specified if ca_server is.')

new = __salt__['x509.create_certificate'](testrun=True, **kwargs)
new = __salt__['x509.create_certificate'](testrun=False, text=True, **kwargs)
new = __salt__['x509.read_certificate'](certificate=new)
newcert = __salt__['x509.create_certificate'](testrun=True, **kwargs)

if isinstance(new, dict):
new_comp = copy.deepcopy(new)
new.pop('Issuer Public Key')
if 'serial_number' not in kwargs:
new_comp.pop('Serial Number')
if 'signing_cert' not in kwargs:
Expand All @@ -549,7 +550,7 @@ def certificate_managed(name,
new_comp.pop('MD5 Finger Print')
new_comp.pop('SHA1 Finger Print')
new_comp.pop('SHA-256 Finger Print')
new_issuer_public_key = new_comp.pop('Issuer Public Key')
new_issuer_public_key = new_issuer_public_key = newcert.pop('Issuer Public Key')
else:
new_comp = new

Expand Down