h2o / picotls

TLS 1.3 implementation in C (master supports RFC8446 as well as draft-26, -27, -28)
536 stars 140 forks source link

Fix Visual Studio warnings when using OpenSSL 3.0 #415

Closed huitema closed 2 years ago

huitema commented 2 years ago

This PR replaces Pr #413, which included too many unrelated commits. The changes affect src\esni.c and t\openssl.c. The file esni.c is only used in tests of ESNI with Visual Studio; the changes there handle the use of providers instead of engines when using OpenSSL 3.0. There are two minor change in t/openssl.c. First, not try using the engine APIs and load the default module instead when using OpenSSLv3 -- as written, the code relied only on a OPENSSL_NO_ENGINE variable, which was not automatically set when using OpenSSL 3.0. Second, undefining the variable OPENSSL_API_COMPAT before including lib/openssl.c, because that variable is defined again inside lib/openssl.c, and Visual Studio protests against redefinition.

The changes resolve issue #412.

kazuho commented 2 years ago

Thank you for the PR. Everything sounds reasonable.