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 987442 - [RFE][usability] Return non zero exit code in ocsp tool on failure
Summary: [RFE][usability] Return non zero exit code in ocsp tool on failure
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openssl
Version: 6.4
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-23 11:43 UTC by Hubert Kario
Modified: 2017-09-06 12:40 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-06 12:40:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
damaged OCSP response (462 bytes, application/octet-stream)
2013-07-23 11:43 UTC, Hubert Kario
no flags Details
CA certificate (1.57 KB, text/plain)
2013-07-23 11:44 UTC, Hubert Kario
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 990913 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 990913

Description Hubert Kario 2013-07-23 11:43:19 UTC
Created attachment 777287 [details]
damaged OCSP response

Description of problem:
`openssl ocsp` tool is often used to check validity of certificates using OCSP, but it's output is specifically designed for human interpretation and not machine checking. Because of that, writing scripts that use it is hard.

For example, even the OCSP check script we distribute in Fedora openvpn is wrong:
/usr/share/doc/openvpn-2.3.2/contrib/OCSP_check/OCSP_check.sh
http://svn.openvpn.net/projects/openvpn/contrib/dazo/contrib/OCSP_check/OCSP_check.sh

It will validate the cert as OK if the signature verification fails.

Version-Release number of selected component (if applicable):
openssl-1.0.0-27.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Get a valid good OCSP response for a valid certificate
2. Mangle the signature
3. Perform signature verification

openssl ocsp -CAfile ca_cert.pem -issuer ca_cert.pem -verify_other ca_cert.pem -serial 0x1212 -no_nonce -respin ocsp.resp
echo $?

Actual results:
Response Verify Failure
140624443094856:error:04091077:rsa routines:INT_RSA_VERIFY:wrong signature length:rsa_sign.c:159:
140624443094856:error:0D0C5006:asn1 encoding routines:ASN1_item_verify:EVP lib:a_verify.c:184:
140624443094856:error:27069075:OCSP routines:OCSP_basic_verify:signature failure:ocsp_vfy.c:98:
0x1212: good
        This Update: Jul 23 11:41:21 2013 GMT
        Next Update: Jul 23 11:41:21 2014 GMT
0

Expected results:
Response Verify Failure
140624443094856:error:04091077:rsa routines:INT_RSA_VERIFY:wrong signature length:rsa_sign.c:159:
140624443094856:error:0D0C5006:asn1 encoding routines:ASN1_item_verify:EVP lib:a_verify.c:184:
140624443094856:error:27069075:OCSP routines:OCSP_basic_verify:signature failure:ocsp_vfy.c:98:
0x1212: good
        This Update: Jul 23 11:41:21 2013 GMT
        Next Update: Jul 23 11:41:21 2014 GMT
1

Additional info:

Comment 1 Hubert Kario 2013-07-23 11:44:22 UTC
Created attachment 777288 [details]
CA certificate

Comment 5 Hubert Kario 2013-07-23 16:32:20 UTC
A bit of additional info: if the server responds with an error message (unauthorized, try_later, etc.), the ocsp command does return non zero error code.

Comment 6 RHEL Program Management 2013-10-14 03:03:44 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 7 Hubert Kario 2017-09-06 12:40:05 UTC
Red Hat Enterprise Linux 6 entered Production 3 stage of its life cycle, that means only selected high priority or security issues will be fixed. See https://access.redhat.com/support/policy/updates/errata for more information

This issue is not considered to be a high priority issue thus it won't be fixed in Red Hat Enterprise Linux 6.

The issue is not present in Red Hat Enterprise Linux 7 (package version tested: openssl-1.0.2k-8.el7.x86_64), thus the bug is closed with resolution NEXTRELEASE.

Please contact Customer Support if you believe that this issue should be addressed in this release of Red Hat Enterprise Linux.


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