#7859 Error adding intermediate CA certs using ipa-cacert-manage
Closed: wontfix 5 years ago by ftweedal. Opened 5 years ago by mpreissner.

Issue

ipa-cacert-manage install fails when attempting to add an intermediate CA certificate, citing "Certificate contains unknown critical extension." CA cert is a valid cert used in the trust chain for certain federal PIV cards.

The Root CA installed without issue.

Steps to Reproduce

  1. From command line as root, ipa-cacert-manage -n "Intermediate CA nickname" -t CT,C,C install piv-intermediate.cer -v

Actual behavior

ipapython.ipautil: DEBUG: stderr=
ipapython.ipautil: DEBUG: Starting external process
ipapython.ipautil: DEBUG: args=/usr/bin/certutil -d dbm:/tmp/tmpNvoEmF -V -n Intermediate CA nickname -u L -f /tmp/tmpNvoEmF/pwdfile.txt
ipapython.ipautil: DEBUG: Process finished, return code=255
ipapython.ipautil: DEBUG: stdout=certutil: certificate is invalid: Certificate contains unknown critical extension.

ipapython.ipautil: DEBUG: stderr=
ipalib.backend: DEBUG: Destroyed connection context.ldap2_140351401842640
ipapython.admintool: DEBUG: File "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 178, in execute
return_value = self.run()
File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_cacert_manage.py", line 128, in run
return self.install()
File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_cacert_manage.py", line 409, in install
"troubleshooting guide)" % e)

ipapython.admintool: DEBUG: The ipa-cacert-manage command failed, exception: ScriptError: Not a valid CA certificate: certutil: certificate is invalid: Certificate contains unknown critical extension.
(visit http://www.freeipa.org/page/Troubleshooting for troubleshooting guide)
ipapython.admintool: ERROR: Not a valid CA certificate: certutil: certificate is invalid: Certificate contains unknown critical extension.
(visit http://www.freeipa.org/page/Troubleshooting for troubleshooting guide)
ipapython.admintool: ERROR: The ipa-cacert-manage command failed.

Expected behavior

Installing CA certificate, please wait
CA certificate successfully installed
The ipa-cacert-manage command was successful

Version/Release/Distribution

ipa-server-4.6.4-10.el7.centos.x86_64
ipa-client-4.6.4-10.el7.centos.x86_64
389-ds-base-1.3.8.4-18.el7_6.x86_64
pki-ca-10.5.9-6.el7.noarch
krb5-server-1.15.1-34.el7.x86_64

Bear with me as I'm new here...can upload the intermediate CA cert once I figure out how...


All we really need is the PEM blob. You can paste that in as a comment in the issue.

If all you have is the DER version you can convert it to PEM:

$ openssl x509 -inform der -in /path/to/cert

Here's the PEM:

-----BEGIN CERTIFICATE-----
MIIF/zCCBOegAwIBAgICLiYwDQYJKoZIhvcNAQELBQAwWTELMAkGA1UEBhMCVVMxGDAWBgNVBAoTD1UuUy4gR292ZXJubWVudDENMAsGA1UECxMERlBLSTEhMB8GA1UEAxMYRmVkZXJhbCBDb21tb24gUG9saWN5IENBMB4XDTE1MDczMDEzMTg1MloXDTI1MDczMDEzMTI0MlowbjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VudHJ1c3QxIjAgBgNVBAsTGUNlcnRpZmljYXRpb24gQXV0aG9yaXRpZXMxKTAnBgNVBAsTIEVudHJ1c3QgTWFuYWdlZCBTZXJ2aWNlcyBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmKijeijcOM2CyoIumDqIrsOiv/Xv25+w9oDZQEMT2bRr5r4cyDsdlHhw8IZhZIrzctn4CK/Of260HyoLpFoKXBEvQ5dhqXLJzlw0pvnALRiaxFevxHL+qPs9qptGETgzRGjBeADS5fx/ecn0eJeeGiPjF+q8c0507/o/0KbS92ciXvC50KHiB6+vSaNtXunpBkbZWCfS/K+ap+7P2xfSmf2pLFngdtXdcHIt3SCKTeWzPK+WJ0CxI484N+UrG6gRH7df0L4MQ2xFk1vfyCI+YVq6cgVXtt6ScDbRFpbrxcYc0M98SdFNWQUUF8klR28dJNEskZYYRb+q4nKKBE4bSQIDAQABo4ICujCCArYwDwYDVR0TAQH/BAUwAwEB/zCBiAYDVR0gBIGAMH4wDAYKYIZIAWUDAgEDBjAMBgpghkgBZQMCAQMHMAwGCmCGSAFlAwIBAwgwDAYKYIZIAWUDAgEDJDAMBgpghkgBZQMCAQMNMA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6EcPjDuWXhRZoCQJ04RxIKPrTYy6Ycf/WvA7jWhSyZcWXLblFL7xKpECDyrt0EDNdb5wxsqWfb707CKN4hRTL4aPsfhBlQsMXfWa
-----END CERTIFICATE-----

Easily reproducible using even a more modern nss, nss-3.41.0-3.fc28.x86_64

I filed an upstream bug aginst nss, https://bugzilla.mozilla.org/show_bug.cgi?id=1525985

The only workaround would be to ignore the error in ipapython/certdb.py in verify_ca_cert_validity()

Initial feedback from NSS devel in the upstream BZ is not encouraging, but RFC 5280 does require support for inhibit anyPolicy and I have reflected this info into the upstream bug.

A less drastic workaround (compared to ignoring validation errors) could be to set NSS_ENABLE_PKIX_VERIFY=1 in the certutil process environment, to force it to use libpkix for validation. I would be hesitant to implement that as the fix though, because there is some stuff that works correctly in the "classic" validation routine that is not handled correctly by libpkix**.

** e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=1523484

This is great support, thanks! Since the certutil command is being called through ipa-cacert-manage, what would be the best way to implement one of the workarounds? I'm guessing that the problem only exists during the initial installation of the CA cert (though I could be wrong); if so, then I just need to get it installed and then I can back out the workaround, assuming that I don't run into issues with the 3rd level CA, or client validation.

What I'm really trying to get done is authenticating users with federal PIV cards over SSH to systems joined to the IPA domain, which is mapping the user certs back to an AD account. I've got functional certificate mapping/matching rules, and can successfully match the cert to the intended user account. I guess I'm questioning whether the IPA domain really needs to trust the chain from which the user cert is issued (current functionality seems to require it) when the authentication is really happening back at Active Directory instead of within IPA.

@mpreissner let me respond point by point.

  • How to implement the workaround? Running ipa-cacert-manage with NSS_ENABLE_PKIX_VERIFY=1 in process environment should work. If you do this (and if it works) then there is no workaround to "back out", it's just a transient environment variable.

  • Problem only exists during initial installation of CA cert? That's my hunch too, but I haven't tested it and can't say for certain that there won't be other issues. In particular, with NSS default cert validation behaviour having this problem, it is likely that some clients (including Firefox) will experience problems. But note that Dogtag uses libpkix for validation, and the FreeIPA framework and CLI client use OpenSSL under the hood (via python-cryptography), so I think (but don't guarantee) that the FreeIPA infrastructure itself shouldn't experience issues.

  • I believe trust of the user cert is necessary but am pinging @sbose for comment.

NSS closed the bug as wontfix so we won't be getting a change to certutil.

@rcritten therefore we too will have to close this wontfix. You'll have to use one of the workarounds (or get an externally-signed CA cert without the inhibit anyPolicy extension.

I'll close it now. If anyone disagrees feel free to continue the discussion, but without a fix in NSS there isn't much we can do...

Metadata Update from @ftweedal:
- Issue close_status updated to: wontfix
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata