Skip to content

Commit

Permalink
xtest: add -DOPENSSL_API_COMPAT=10100
Browse files Browse the repository at this point in the history
regression_1000.c uses OpenSSL functions that have been deprecated
after version 1.1. In particular, building with version 3.0 causes the
following error (and other similar ones not pasted here):

 optee_test/host/xtest/regression_1000.c: In function 'check_signature':
 optee_test/host/xtest/regression_1000.c:2735:9: error: 'SHA256_Init' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  2735 |         SHA256_Init(&ctx);
       |         ^~~~~~~~~~~

Add -DOPENSSL_API_COMPAT=10100 to the build flags to avoid this and be
flexible with regards to which version of OpenSSL build environment has
to provide.

Signed-off-by: Jerome Forissier <[email protected]>
Acked-by: Jens Wiklander <[email protected]>
  • Loading branch information
jforissier committed Aug 3, 2023
1 parent fa2fb9b commit cf11160
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion host/xtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()

find_package(OpenSSL)
if(OPENSSL_FOUND)
add_compile_options(-DOPENSSL_FOUND=1)
add_compile_options(-DOPENSSL_FOUND=1 -DOPENSSL_API_COMPAT=10100)
set (OPENSSL_PRIVATE_LINK OpenSSL::Crypto)
endif()

Expand Down
2 changes: 1 addition & 1 deletion host/xtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endef
# - User/group login tests 1027 and 1028
WITH_OPENSSL ?= y
ifeq ($(WITH_OPENSSL),y)
CFLAGS += -DOPENSSL_FOUND=1
CFLAGS += -DOPENSSL_FOUND=1 -DOPENSSL_API_COMPAT=10100
ifneq ($(OPTEE_OPENSSL_EXPORT),)
LDFLAGS += -lcrypto
CFLAGS += -I$(OPTEE_OPENSSL_EXPORT)
Expand Down

0 comments on commit cf11160

Please sign in to comment.