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

op-mode: T6400: pki: unable to generate fingerprint for ACME issued certificates #3518

Merged
merged 1 commit into from
May 26, 2024
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
13 changes: 5 additions & 8 deletions src/op_mode/pki.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@
print("Certificate Authorities:")
print(tabulate.tabulate(data, headers))

def show_certificate(name=None, pem=False):
def show_certificate(name=None, pem=False, fingerprint_hash=None):
headers = ['Name', 'Type', 'Subject CN', 'Issuer CN', 'Issued', 'Expiry', 'Revoked', 'Private Key', 'CA Present']
data = []
certs = get_config_certificate()
Expand All @@ -897,6 +897,9 @@
if name and pem:
print(encode_certificate(cert))
return
elif name and fingerprint_hash:
print(get_certificate_fingerprint(cert, fingerprint_hash))
Dismissed Show dismissed Hide dismissed
return

ca_name = get_certificate_ca(cert, ca_certs)
cert_subject_cn = cert.subject.rfc4514_string().split(",")[0]
Expand All @@ -923,12 +926,6 @@
print("Certificates:")
print(tabulate.tabulate(data, headers))

def show_certificate_fingerprint(name, hash):
cert = get_config_certificate(name=name)
cert = load_certificate(cert['certificate'])

print(get_certificate_fingerprint(cert, hash))

def show_crl(name=None, pem=False):
headers = ['CA Name', 'Updated', 'Revokes']
data = []
Expand Down Expand Up @@ -1074,7 +1071,7 @@
if args.fingerprint is None:
show_certificate(None if args.certificate == 'all' else args.certificate, args.pem)
else:
show_certificate_fingerprint(args.certificate, args.fingerprint)
show_certificate(args.certificate, fingerprint_hash=args.fingerprint)
elif args.crl:
show_crl(None if args.crl == 'all' else args.crl, args.pem)
else:
Expand Down
Loading