Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for what happens when no certificate is configured
We have ssl_has_certificate and ssl_has_private_key calls scattered throughout libssl, but they're never actually tested. The checks are also a little subtle because of cert->chain's weird representation of the leaf being missing but a chain configured. In hindsight, possibly we should have made them separate fields, but it's too late now. We'd have to get rid of SSL_CTX_get0_chain and SSL_get0_chain. Normally we don't bother with these functions, under the "you should know what you configured" theory, but one caller needed it recently in https://boringssl-review.googlesource.com/c/boringssl/+/66087 The tests also confirm that most of the ssl_has_private_key calls, other than the one in ssl_has_certificate, are redundant. The ssl_has_certificate calls are also in an odd place. This will all get shuffled around with SSL_CREDENTIAL, so set up tests first. Bug: 249 Change-Id: If1bb7097a15649e593886c3c22e2cc829a853830 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66508 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
- Loading branch information