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.
Description of problem:
certmonger unit test 004-selfsign-dsa is failing:
Generating key. This may take a few moments...
Notice: Trust flag u is set automatically if the private key is present.
2018-03-05 13:38:56 [24095] Found token 'NSS Certificate DB'.
2018-03-05 13:38:56 [24095] Located a certificate with the key's nickname ("keyi2048").
2018-03-05 13:38:56 [24095] Located its private key.
2018-03-05 13:38:56 [24095] Recovered public key from private key.
2018-03-05 13:38:56 [24098] Found token 'NSS Certificate DB'.
2018-03-05 13:38:56 [24098] Located a certificate with the key's nickname ("keyi2048").
2018-03-05 13:38:56 [24098] Located its private key.
2018-03-05 13:38:56 [24098] Recovered public key from private key.
2018-03-05 13:38:56 [24098] Setting certificate serial number "04".
2018-03-05 13:38:56 [24106] Setting certificate serial number "04".
error in verification: SEC_ERROR_BAD_DER
error in verification: SEC_ERROR_BAD_DER
Test complete.
The test works with RHEL 7.4 nss-3.28.4-15.el7_4.x86_64 and no certmonger code changed in the interm.
Version-Release number of selected component (if applicable):
nss-3.34.0-4.el7.x86_64
How reproducible:
Every time
Steps to Reproduce:
1. Try to build certmonger in RHEL 7.5
Additional info:
A way to debug is in-tree in the certmonger source is to modify run.sh to include something like:
tmpdir="/tmp/foo"
srcdir="/home/<yourname>/rpmbuild/BUILD/certmonger-0.78.4/tests"
toolsdir="/home/<yourname>/rpmbuild/BUILD/certmonger-0.78.4/tests/tools"
CERTMONGER_CONFIG_DIR=${srcdir}
export CERTMONGER_CONFIG_DIR
cd "$tmpdir"
Now you can execute run.sh directly.
I did this by executing rpmbuild --rebuild certmonger-0.78.4-3.el7.src.rpm and then switching to the BUILD directory after the tests fail.
It also fails in 004-selfsign-ec
Comment 8Kai Engert (:kaie) (inactive account)
2018-03-05 20:41:05 UTC
Comment 11Kai Engert (:kaie) (inactive account)
2018-03-05 20:45:20 UTC
Created attachment 1404504[details]
cert text dump
Bob, Hubert, any idea what properties of this certificate could cause NSS 3.36 to fail decoding this certificate with BAD_DER, while NSS 3.28 had worked?
Well, I don't know if this encoding is valid. Another potential explanation could be that NSS 3.36 produced an invalid encoding.
I've got no clue, it looks sane and openssl parses it without issue, but it complaints about not being able to get issuer, despite this cert looking self-signed:
$ openssl verify -CAfile cert.nss.2048 cert.nss.2048
CN = Babs Jensen
error 20 at 0 depth lookup: unable to get local issuer certificate
error cert.nss.2048: verification failed
maybe "X509v3 Subject Key Identifier" is calculated wrong?
Comment 14Kai Engert (:kaie) (inactive account)
2018-03-06 15:24:24 UTC
This bug is seen with NSS 3.34. It might be worth repeating the test with the nss-softokn 3.36 packages that Daiki is currently working on. Although I don't have a lot of hope that it makes a difference.
Created attachment 1405176[details]
minimal reproducer
OK, I realized that this is a problem in the test program (it worked before because the old decoder is more tolerant about the length). When decoding BIT_STRING either with the old decoder or QuickDER, the length is returned in the number of bits instead of octets; so 504 / 8 = 64.
On the other hand, VFY_VerifyDataWithAlgorithmIDI() expects octet length for the signature value. So you need to adjust it with something like:
signed_data.signature.len /= 8;
before calling that function.
I am attaching the standalone version of checksig.c, which can be compiled with:
$ gcc -o checksig checksig.c `pkg-config nss --cflags --libs`
Feed the "der" file attached at comment 9:
$ cat der | ./checksig
error in verification: SEC_ERROR_BAD_DER
If you comment out the line 95 (which adds the above adjustment) and recompile it:
$ cat der | ./checksig
verification OK
Comment 20Kai Engert (:kaie) (inactive account)
2018-03-07 10:22:00 UTC
Bob, thanks for the analysis.
Daiki, thanks for identifying the fix!
I'm attaching Daiki's suggested fix, and reassigning to certmonger.
Rob, could you please verify it fixes the issue?
Comment 21Kai Engert (:kaie) (inactive account)
2018-03-07 10:22:47 UTC
IPA version: ipa-server-4.6.4-3.el7.x86_64
Certmonger: certmonger-0.78.4-3.el7.x86_64
Verified that the sanity tests required for verifying this bug are run successfully.
No errors are observed when test run for ipa-getcert are run as regression for latest version.
Thus marking the status of bug to Verified, based on these observations.
(In reply to Nikhil Dehadrai from comment #31)
> IPA version: ipa-server-4.6.4-3.el7.x86_64
> Certmonger: certmonger-0.78.4-3.el7.x86_64
>
> Verified that the sanity tests required for verifying this bug are run
> successfully.
>
> No errors are observed when test run for ipa-getcert are run as regression
> for latest version.
>
> Thus marking the status of bug to Verified, based on these observations.
certmonger version: certmonger-0.78.4-8.el7.x86_64
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, 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-2018:3018
Description of problem: certmonger unit test 004-selfsign-dsa is failing: Generating key. This may take a few moments... Notice: Trust flag u is set automatically if the private key is present. 2018-03-05 13:38:56 [24095] Found token 'NSS Certificate DB'. 2018-03-05 13:38:56 [24095] Located a certificate with the key's nickname ("keyi2048"). 2018-03-05 13:38:56 [24095] Located its private key. 2018-03-05 13:38:56 [24095] Recovered public key from private key. 2018-03-05 13:38:56 [24098] Found token 'NSS Certificate DB'. 2018-03-05 13:38:56 [24098] Located a certificate with the key's nickname ("keyi2048"). 2018-03-05 13:38:56 [24098] Located its private key. 2018-03-05 13:38:56 [24098] Recovered public key from private key. 2018-03-05 13:38:56 [24098] Setting certificate serial number "04". 2018-03-05 13:38:56 [24106] Setting certificate serial number "04". error in verification: SEC_ERROR_BAD_DER error in verification: SEC_ERROR_BAD_DER Test complete. The test works with RHEL 7.4 nss-3.28.4-15.el7_4.x86_64 and no certmonger code changed in the interm. Version-Release number of selected component (if applicable): nss-3.34.0-4.el7.x86_64 How reproducible: Every time Steps to Reproduce: 1. Try to build certmonger in RHEL 7.5 Additional info: A way to debug is in-tree in the certmonger source is to modify run.sh to include something like: tmpdir="/tmp/foo" srcdir="/home/<yourname>/rpmbuild/BUILD/certmonger-0.78.4/tests" toolsdir="/home/<yourname>/rpmbuild/BUILD/certmonger-0.78.4/tests/tools" CERTMONGER_CONFIG_DIR=${srcdir} export CERTMONGER_CONFIG_DIR cd "$tmpdir" Now you can execute run.sh directly. I did this by executing rpmbuild --rebuild certmonger-0.78.4-3.el7.src.rpm and then switching to the BUILD directory after the tests fail. It also fails in 004-selfsign-ec