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.
There are 2 points to fix:
* Error codes have to be modified to match the new function.
* The last error from OpenSSL stack should be picked rather that the first one which is always CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA[1], therefore it does not allow to differentiate an error caused by an unaccepted digest algorithm and an invalid signature.
The error code we could expect based on the code of OpenSSL CMS signature verification are:
* CMS_R_NO_MATCHING_DIGEST[2]
* CMS_R_NO_MATCHING_SIGNATURE (not used in practice)
* CMS_R_UNKNOWN_DIGEST_ALGORITHM[3]
But I've run some tests and the error codes that seems to be actually raised are:
* EVP_R_INVALID_DIGEST: the OID is recognized the algorithm is not allowed by the policy in signature verification
* RSA_R_DIGEST_NOT_ALLOWED: OpenSSL fails to infer a signature algorithm based on the digest one and the key type (the more generic code PROV_R_DIGEST_NOT_ALLOWED might be considered too)
* CMS_R_VERIFICATION_FAILURE: signature verification failed
We should use ERR_peek_last_error()[4] instead of ERR_peek_error() in order to get these error codes.
[1] https://github.com/openssl/openssl/blob/openssl-3.0.1/crypto/cms/cms_err.c#L45-L46
[2] https://github.com/openssl/openssl/blob/openssl-3.0.1/crypto/cms/cms_lib.c#L458
[3] https://github.com/openssl/openssl/blob/openssl-3.0.1/crypto/cms/cms_sd.c#L869
[4] https://www.openssl.org/docs/man3.0/man3/ERR_peek_last_error.html
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 (Moderate: krb5 security, 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/RHSA-2023:2570