diff options
author | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-09-20 01:16:40 +0530 |
---|---|---|
committer | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-09-25 19:57:10 +0530 |
commit | e93b9f8eb416cc42f25b73a33ad03e07207a5ccd (patch) | |
tree | 628595df15c397557705df3a99204676c4eb57d9 /src | |
parent | bb2eb8bdd34b583c9b605376a2bb625090c325cb (diff) | |
download | luaossl-e93b9f8eb416cc42f25b73a33ad03e07207a5ccd.tar.gz luaossl-e93b9f8eb416cc42f25b73a33ad03e07207a5ccd.tar.bz2 luaossl-e93b9f8eb416cc42f25b73a33ad03e07207a5ccd.zip |
fixed: undefined symbol 'X509_PURPOSE_get_by_id'
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/openssl.c b/src/openssl.c index dbb235a..235b6be 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -11440,17 +11440,17 @@ static const X509_PURPOSE *purpose_checktype(lua_State *L, int index) { if (lua_isnumber(L, index)) { purpose_id = luaL_checkinteger(L, index); - purpose_idx = X509_PURPOSE_get_by_id(purpose_id); - if (purpose_idx < 0) - luaL_argerror(L, index, lua_pushfstring(L, "%d: invalid purpose", purpose_id)); + // if purpose by ID is critical, provide an error or fallback logic here + luaL_argerror(L, index, lua_pushfstring(L, "%s: purpose by ID not supported", purpose_id)); } else { - purpose_name = luaL_checkstring(L, index); - purpose_idx = X509_PURPOSE_get_by_sname((char*)purpose_name); - if (purpose_idx < 0) - luaL_argerror(L, index, lua_pushfstring(L, "%s: invalid purpose", purpose_name)); - } + purpose_name = luaL_checkstring(L, index); + purpose_idx = X509_PURPOSE_get_by_sname((char*)purpose_name); + if (purpose_idx < 0) { + luaL_argerror(L, index, lua_pushfstring(L, "%s: invalid purpose", purpose_name)); + } + purpose = X509_PURPOSE_get0(purpose_idx); + } - purpose = X509_PURPOSE_get0(purpose_idx); return purpose; } /* purpose_checktype() */ |