-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/ocsp: "OCSP response contains bad number of certificates" error #21527
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
Comments
Sorry, misattributed the initial commit to Russ. He just moved it to a subrepo from the Go repo. Initial commit was 8286ee4 by Adam. |
That is correct, the Go ocsp package is just a bit limited and doesn't have support for more complex responses. From https://godoc.org/golang.org/x/crypto/ocsp#ParseResponse:
/cc @agl |
I interpreted this to mean a single certificate sent in the request. Not a single OCSP response certificate. |
Change https://golang.org/cl/57510 mentions this issue: |
@agl @FiloSottile I would love to get this in for 1.11 if the approach makes sense. It causes us to get "OCSP response contains bad number of certificates" for any certificates that use cybertrust.ne.jp's various OCSP responders. For example, https://www.superchoice.bet/ |
🤦♂️ duh, I forgot this was in x/crypto and doesn't follow the release process. Still, please take a look once the 1.11 freeze fury has died down! |
It was mentioned in the CL, but for better visibility: At the time this was merged there were many OCSP responders that triggered this. 209 by my count: https://crt.sh/ocsp-responders?get=OCSP+response+contains+bad+number+of+certificates&sort=2&dir=v |
Just FYI, crt.sh now has this fix, and all of the "bad number of certificates" errors have disappeared. |
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Some OCSP responders contain more than one certificate, which can be used to "help the OCSP client verify the responders signature" (RFC 6960 section 4.2.1). This client doesn't do verification of the chain to the root, but it's not an error for a responder to send more than one. Fixes golang/go#21527 Change-Id: Ie23cfcb347a4f7cdfb1a0cbad2aa03a1242553af Reviewed-on: https://go-review.googlesource.com/57510 Reviewed-by: Adam Langley <agl@golang.org>
Currently in the
ocsp.ParseResponseForCert
function is a block:I can't find any justification for this check (it dates back to @rsc's initial commit). RFC 6960 section 4.2.1 says,
This leads me to believe that more than one cert is valid here, and in fact the http://sureseries-ocsp.cybertrust.ne.jp/OcspServer responder sends certs chaining up to a root.
The Go OCSP implementation doesn't verify the response certificate to a root, it just checks the signature against the issuer. (Is this sufficient? OpenSSL seems to do more.) But it seems like it shouldn't be an error to receive more than one certificate; it could simply do the check it currently does against the first one in the list.
/cc @agl
The text was updated successfully, but these errors were encountered: