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 Denier: invalid ASN.1 syntax for OCSPResponse #18

Open
droe opened this issue Apr 22, 2012 · 1 comment
Open

OCSP Denier: invalid ASN.1 syntax for OCSPResponse #18

droe opened this issue Apr 22, 2012 · 1 comment

Comments

@droe
Copy link

droe commented Apr 22, 2012

OCSPDenier::ocspResponse in http/OCSPDenier.cpp contains an syntactically invalid OCSP response. OCSPResponse according to RFC 2560:

4.2.1  ASN.1 Specification of the OCSP Response

   An OCSP response at a minimum consists of a responseStatus field
   indicating the processing status of the prior request. If the value
   of responseStatus is one of the error conditions, responseBytes are
   not set.

   OCSPResponse ::= SEQUENCE {
      responseStatus         OCSPResponseStatus,
      responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }

   OCSPResponseStatus ::= ENUMERATED {
       successful            (0),  --Response has valid confirmations
       malformedRequest      (1),  --Illegal confirmation request
       internalError         (2),  --Internal error in issuer
       tryLater              (3),  --Try again later
                                   --(4) is not used
       sigRequired           (5),  --Must sign the request
       unauthorized          (6)   --Request unauthorized
   }
[...]

So instead of the string "3", the HTTP response body should contain an ASN.1 SEQUENCE, containing an ENUMERATED with the value 0x03 to be a valid OCSP response, which is a total of 5 bytes in the case of tryLater (responseBytes is not needed).

Incidentally, clients seem to ignore ASN.1 syntax errors in OCSP responses, so fixing this might not actually change client behaviour for many OCSP client implementations.

@droe
Copy link
Author

droe commented Apr 22, 2012

This can be tested using OpenSSL as follows, where sslsniff is listening on port 10080:

% openssl ocsp -issuer ca.crt -serial 1234 -url http://127.0.0.1:10080/ocsp
Error querying OCSP responsder

Which is a client-local error. It should show Responder Error: trylater (3) if it received a tryLater from the OCSP server.

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

1 participant