Skip to content

Commit

Permalink
chore: refactor for libressl 3.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Jan 1, 2025
1 parent deeef7b commit f331651
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static LUA_FUNCTION(openssl_list)
{
OBJ_NAME_TYPE_MD_METH,
OBJ_NAME_TYPE_CIPHER_METH,
#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x40000000L
#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x30900000L
/* NOTE: libressl 4.0.0 */
OBJ_NAME_TYPE_PKEY_METH,
OBJ_NAME_TYPE_COMP_METH
Expand All @@ -159,7 +159,7 @@ static LUA_FUNCTION(openssl_list)
static const char *names[] = {
"digests",
"ciphers",
#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x40000000L
#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x30900000L
"pkeys",
"comps",
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/ots.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static int openssl_ts_msg_imprint_new(lua_State *L)
if (ret == 1)
{
X509_ALGOR* alg = X509_ALGOR_new();
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x40000000L
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30900000L
X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), V_ASN1_NULL, NULL);
#else
X509_ALGOR_set_md(alg, md);
Expand Down
2 changes: 1 addition & 1 deletion src/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs);
lua_pop(L,1); \
}

#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x40000000L
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30900000L
#if !defined(OPENSSL_NO_CRYPTO_MDEBUG)
#define OPENSSL_NO_CRYPTO_MDEBUG
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/xalgor.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int openssl_xalgor_md(lua_State* L)
{
X509_ALGOR* alg = CHECK_OBJECT(1, X509_ALGOR, "openssl.x509_algor");
const EVP_MD* md = get_digest(L, 2, NULL);
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x40000000L
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30900000L
X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), V_ASN1_NULL, NULL);
#else
X509_ALGOR_set_md(alg, md);
Expand Down

0 comments on commit f331651

Please sign in to comment.