Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCSP_basic_verify does not work with OpenSSL 1.1.1 #20

Open
tatsuhiro-t opened this issue Sep 15, 2018 · 3 comments
Open

OCSP_basic_verify does not work with OpenSSL 1.1.1 #20

tatsuhiro-t opened this issue Sep 15, 2018 · 3 comments

Comments

@tatsuhiro-t
Copy link
Contributor

There are 2 issues I found with OCSP.

  1. When neverbleed is enabled, OCSP_basic_verify with RSA key because RSA object has NULL bn_mod_exp. This can be fixed by just assigning default function to the field. But I propose to use RSA_meth_dup first, and then override custom functions instead.

  2. If optional certificate is attached in OCSP response, priv_rsa_finish or priv_ecdsa_finish is called when OCSP_BASICRESP_free is called. In that function chain, we end up calling RSA_get_ex_data or
    EC_KEY_get_ex_data, but we don't set its associated data, it fails and we hit dief.
    One possible workaround is don't call dief if we cannot get any data from these functions and just do nothing without communicating daemon process. What do you think?

Issue 1 is new to OpenSSL 1.1.1.
I don't know Issue 2 happens with older OpenSSL. I just found it while debugging Issue 1.

@kazuho
Copy link
Member

kazuho commented Sep 20, 2018

Thank you for noticing, diagnosing, reporting, and fixing the issue.

#23 that fixes the 1st issue has been merged. Are you aware a method reproducing the 2nd issue?

@tatsuhiro-t
Copy link
Contributor Author

You can create OCSP response using openssl ocsp utility and can include certificate in it.

@tatsuhiro-t
Copy link
Contributor Author

Create OCSP request

openssl ocsp -issuer CA.crt -cert server.crt -reqout req.der

Create OCSP response

openssl ocsp -index index.txt -rsigner CA.crt -rkey CA.key -CA CA.crt -reqin req.der -respout resp.der

Syntax of index.txt

Tab delimited text files:

  • V = verified, R = revoked, E = expired
  • YYMMDDhhmmddZ: expiration date of certificate
  • YYMMDDhhmmddZ: revoked date (empty if it has not been revoked)
  • Serial: Serial number of certificate in hex (alphabet must be upper cased)
  • Path to certificate: just write unknown
  • Subject: /X=Z... style

Describe OCSP response

openssl ocsp -respin resp.der -text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants