Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Cause: certmonger is encoding a DER default boolean value in the Certificate Signing Request it generates.
Consequence: The resulting CSR is not compliant with strict DER readers
Fix: Apply the OPTIONAL flag and use the upstream NSS CSR template.
Result: The CSR that certmonger generates is valid.
Description of problem:
certmonger's template for X509v3 extensions is wrong and generate invalid DER for extensions with critical=FALSE. Since FALSE is the default value, a standard conform CSR or cert must not encode the critical flag.
$ openssl asn1parse -inform PEM -in freeipa.csr
...
421:d=7 hl=2 l= 3 prim: OBJECT :X509v3 Subject Alternative Name
426:d=7 hl=2 l= 1 prim: BOOLEAN :0
429:d=7 hl=3 l= 135 prim: OCTET STRING [HEX DUMP]:...
The line BOOLEAN 0 should not be present.
/* RFC 5280, 4.1 */
const SEC_ASN1Template
cm_certext_cert_extension_template[] = {
{
.kind = SEC_ASN1_SEQUENCE,
.offset = 0,
.sub = NULL,
.size = sizeof(CERTCertExtension),
},
{
.kind = SEC_ASN1_OBJECT_ID,
.offset = offsetof(CERTCertExtension, id),
.sub = NULL,
.size = sizeof(SECItem),
},
{
.kind = SEC_ASN1_BOOLEAN,
.offset = offsetof(CERTCertExtension, critical),
.sub = NULL,
.size = sizeof(SECItem),
},
{
.kind = SEC_ASN1_OCTET_STRING,
.offset = offsetof(CERTCertExtension, value),
.sub = NULL,
.size = sizeof(SECItem),
},
{0, 0, NULL, 0},
};
The correct kind for the critical extension is SEC_ASN1_OPTIONAL | SEC_ASN1_BOOLEAN.
https://github.com/servo/nss/blob/949eb9848f4fa5f83756f3ab7fdf9b0d3f20d37f/lib/certdb/certdb.c#L50https://github.com/pyca/cryptography/issues/6368https://pagure.io/freeipa/issue/9005
Version-Release number of selected component (if applicable):
certmonger-0.79.13-3
How reproducible:
Steps to Reproduce:
1. install an IPA server
2. pull the csr= value from /var/lib/certmonger/reqeusts/<some id> into a separate file
3. openssl asn1parse -inform PEM -in /path/to/file
Expected results:
There should be no BOOLEAN value for the critical flag, so nothing between the SAN and the start of the HEX DUMP.
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 (certmonger 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:1789
Description of problem: certmonger's template for X509v3 extensions is wrong and generate invalid DER for extensions with critical=FALSE. Since FALSE is the default value, a standard conform CSR or cert must not encode the critical flag. $ openssl asn1parse -inform PEM -in freeipa.csr ... 421:d=7 hl=2 l= 3 prim: OBJECT :X509v3 Subject Alternative Name 426:d=7 hl=2 l= 1 prim: BOOLEAN :0 429:d=7 hl=3 l= 135 prim: OCTET STRING [HEX DUMP]:... The line BOOLEAN 0 should not be present. /* RFC 5280, 4.1 */ const SEC_ASN1Template cm_certext_cert_extension_template[] = { { .kind = SEC_ASN1_SEQUENCE, .offset = 0, .sub = NULL, .size = sizeof(CERTCertExtension), }, { .kind = SEC_ASN1_OBJECT_ID, .offset = offsetof(CERTCertExtension, id), .sub = NULL, .size = sizeof(SECItem), }, { .kind = SEC_ASN1_BOOLEAN, .offset = offsetof(CERTCertExtension, critical), .sub = NULL, .size = sizeof(SECItem), }, { .kind = SEC_ASN1_OCTET_STRING, .offset = offsetof(CERTCertExtension, value), .sub = NULL, .size = sizeof(SECItem), }, {0, 0, NULL, 0}, }; The correct kind for the critical extension is SEC_ASN1_OPTIONAL | SEC_ASN1_BOOLEAN. https://github.com/servo/nss/blob/949eb9848f4fa5f83756f3ab7fdf9b0d3f20d37f/lib/certdb/certdb.c#L50 https://github.com/pyca/cryptography/issues/6368 https://pagure.io/freeipa/issue/9005 Version-Release number of selected component (if applicable): certmonger-0.79.13-3 How reproducible: Steps to Reproduce: 1. install an IPA server 2. pull the csr= value from /var/lib/certmonger/reqeusts/<some id> into a separate file 3. openssl asn1parse -inform PEM -in /path/to/file Expected results: There should be no BOOLEAN value for the critical flag, so nothing between the SAN and the start of the HEX DUMP.