JosiahWI commented on code in PR #9924:
URL: https://github.com/apache/trafficserver/pull/9924#discussion_r1245085969
##########
CMakeLists.txt:
##########
@@ -167,7 +167,14 @@ endif()
find_package(PCRE)
include(FindOpenSSL)
Review Comment:
Since you're cleaning up the OpenSSL checks, can we remove this direct
inclusion of `FindOpenSSL`? `find_package` should find the right module to
include for us.
##########
CMakeLists.txt:
##########
@@ -167,7 +167,14 @@ endif()
find_package(PCRE)
include(FindOpenSSL)
+include(CheckOpenSSLIsBoringSSL)
find_package(OpenSSL)
+check_openssl_is_boringssl(OPENSSL_IS_BORINGSSL "${OPENSSL_INCLUDE_DIR}")
+
+if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0")
+ set(OPENSSL_IS_OPENSSL3 ON)
Review Comment:
Could we use `TRUE` for internal checks? I think it helps distinguish
between options that can be toggled, and deterministic checks.
##########
CMakeLists.txt:
##########
@@ -167,7 +167,14 @@ endif()
find_package(PCRE)
include(FindOpenSSL)
+include(CheckOpenSSLIsBoringSSL)
find_package(OpenSSL)
+check_openssl_is_boringssl(OPENSSL_IS_BORINGSSL "${OPENSSL_INCLUDE_DIR}")
+
+if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0")
+ set(OPENSSL_IS_OPENSSL3 ON)
+ add_compile_definitions(OPENSSL_API_COMPAT=10002 OPENSSL_IS_OPENSSL3)
Review Comment:
`./plugins/certifier/CMakeLists.txt:add_definitions(-DOPENSSL_API_COMPAT=10002)`
Interesting, this is duplicated in the certifier. That's not necessarily bad
because it helps decouple, but I'm wondering whether the one in certifier
should also be guarded by a conditional.
##########
src/tscore/CMakeLists.txt:
##########
@@ -103,6 +102,14 @@ add_library(tscore SHARED
)
add_library(ts::tscore ALIAS tscore)
+if(OPENSSL_IS_BORINGSSL)
+ target_sources(tscore PUBLIC HKDF_boringssl.cc)
+elseif(OPENSSL_IS_OPENSSL3)
+ target_sources(tscore PUBLIC HKDF_openssl3.cc)
+else()
+ target_sources(tscore PUBLIC HKDF_openssl.cc)
Review Comment:
Seeing a `PUBLIC` usage requirement for target sources is like seeing Santa
Clause driving his sleigh in December without his coat on. Are we doing
something fancy, or should these be `PRIVATE`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]