From 5213918fe2cbd3975f617821b8401c374709e83c Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Wed, 30 Mar 2022 15:05:42 +0200 Subject: [PATCH] BUILD: ssl/lua: CacheCert needs OpenSSL Return an lua error when trying to use CacheCert.set() and OpenSSL was not used to build HAProxy. --- src/hlua.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/hlua.c b/src/hlua.c index b925c2496..ea75b16eb 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -11369,6 +11369,7 @@ static struct cfg_kw_list cfg_kws = {{ },{ INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws); +#ifdef USE_OPENSSL /* * This function replace a ckch_store by another one, and rebuild the ckch_inst and all its dependencies. @@ -11551,6 +11552,18 @@ end: return 0; } +#else + +__LJMP static int hlua_ckch_set(lua_State *L) +{ + WILL_LJMP(luaL_error(L, "'CertCache.set' needs an HAProxy built with OpenSSL")); + + return 0; +} +#endif /* ! USE_OPENSSL */ + + + /* This function can fail with an abort() due to an Lua critical error. * We are in the initialisation process of HAProxy, this abort() is * tolerated.