RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2121044 - Error parsing EK ASN.1 certificate of Nuvoton HW TPM
Summary: Error parsing EK ASN.1 certificate of Nuvoton HW TPM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: keylime
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Sergio Correia
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-24 10:34 UTC by Karel Srot
Modified: 2022-11-15 11:40 UTC (History)
2 users (show)

Fixed In Version: keylime-6.4.3-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:34:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github keylime keylime pull 1084 0 None open registrar: parse EK cert with pyasn1 2022-08-24 11:39:49 UTC
Red Hat Issue Tracker RHELPLAN-132180 0 None None None 2022-08-24 10:43:21 UTC
Red Hat Issue Tracker SECENGSP-4729 0 None None None 2022-08-24 10:43:23 UTC
Red Hat Product Errata RHBA-2022:8189 0 None None None 2022-11-15 10:34:30 UTC

Description Karel Srot 2022-08-24 10:34:57 UTC
Description of problem:

This is tracked upstream in https://github.com/keylime/keylime/issues/944

When running the basic attestation scenario on localhost the agent fails to register and the following message is logged by registrar

2022-03-28 05:42:13,737 keylime.tpm INFO TPM2-TOOLS Version: 5.0
2022-03-28 05:42:13,752 keylime.registrar WARNING POST for d432fbb3-d2f1-4a97-9ef7-75bd81c00000 returning 400 response. Error: error parsing asn1 value: ParseError { kind: InvalidSetOrdering, location: ["RawCertificate::tbs_cert", "TbsCertificate::issuer", "0", "2"] }
2022-03-28 05:42:13,752 keylime.registrar WARNING POST for d432fbb3-d2f1-4a97-9ef7-75bd81c00000 returning 400 response. Error: error parsing asn1 value: ParseError { kind: InvalidSetOrdering, location: ["RawCertificate::tbs_cert", "TbsCertificate::issuer", "0", "2"] }
2022-03-28 05:42:13,753 keylime.registrar ERROR error parsing asn1 value: ParseError { kind: InvalidSetOrdering, location: ["RawCertificate::tbs_cert", "TbsCertificate::issuer", "0", "2"] }
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/keylime-6.3.1-py3.9.egg/keylime/registrar_common.py", line 287, in do_POST
    ek509 = load_der_x509_certificate(
  File "/usr/local/lib64/python3.9/site-packages/cryptography/x509/base.py", line 538, in load_der_x509_certificate
    return rust_x509.load_der_x509_certificate(data)
ValueError: error parsing asn1 value: ParseError { kind: InvalidSetOrdering, location: ["RawCertificate::tbs_cert", "TbsCertificate::issuer", "0", "2"] }

I have tested it also with the latest cryptography module available in PIP v36.0.2, same behavior.

TPM EK cert cannot be parsed by cryptography module but it can be parsed by openssl (openssl-3.0.1)

---

The issuer attribute seems non standard: Issuer: CN = Nuvoton TPM Root CA 2110 + O = Nuvoton Technology Corporation + C = TW. Normally those fields should be comma separated not with a +.

The issue is likely in the ASN.1 parser used by cryptography.


Version-Release number of selected component (if applicable):
keylime-6.4.2-2.el9

Comment 9 errata-xmlrpc 2022-11-15 10:34:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (keylime bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8189


Note You need to log in before you can comment on or make changes to this bug.