Fix ossl_shim SNI handling
authorBenjamin Kaduk <bkaduk@akamai.com>
Wed, 25 Jul 2018 19:48:30 +0000 (14:48 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 26 Jul 2018 20:06:53 +0000 (15:06 -0500)
commit45a2353056da3f357a924131578ad0a4a2e5fbb7
tree72f0aaad7ab7de32d7a53e06e70d7ba5e1b4e14b
parent9d91530d2d7da1447b7be8631b269599023430e7
Fix ossl_shim SNI handling

To start with, actually set an SNI callback (copied from bssl_shim); we
weren't actually testing much otherwise (and just happened to have been
passing due to buggy libssl behavior prior to
commit 1c4aa31d79821dee9be98e915159d52cc30d8403).

Also use proper C++ code for handling C strings -- when a C API
(SSL_get_servername()) returns NULL instead of a string, special-case
that instead of blindly trying to compare NULL against a std::string,
and perform the comparsion using the std::string operators instead of
falling back to pointer comparison.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6792)
test/ossl_shim/ossl_shim.cc