aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_rsa.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-09-23 19:15:44 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-09-23 19:15:44 +0100
commitf9f75097a286e69e38929a4a02172645e7f77a8f (patch)
treef5571f5cdb9336ca1dfab5478c8fe48b6685e222 /src/lua/lua_rsa.c
parent5cee6930616250c6a45fc5af115656a5a7edad52 (diff)
downloadrspamd-f9f75097a286e69e38929a4a02172645e7f77a8f.tar.gz
rspamd-f9f75097a286e69e38929a4a02172645e7f77a8f.zip
[Fix] Get rid of EVP_PKEY_CTX_set1_rsa_keygen_pubexp
OpenSSL uses 65537 by default, no need in explicit set.
Diffstat (limited to 'src/lua/lua_rsa.c')
-rw-r--r--src/lua/lua_rsa.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/lua/lua_rsa.c b/src/lua/lua_rsa.c
index b7be612b0..78534c682 100644
--- a/src/lua/lua_rsa.c
+++ b/src/lua/lua_rsa.c
@@ -791,7 +791,6 @@ lua_rsa_sign_memory(lua_State *L)
static int
lua_rsa_keypair(lua_State *L)
{
- BIGNUM *e;
EVP_PKEY *pkey = NULL, *pub_pkey, *priv_pkey, **ppkey;
int bits = lua_gettop(L) > 0 ? lua_tointeger(L, 1) : 1024;
@@ -799,16 +798,11 @@ lua_rsa_keypair(lua_State *L)
return luaL_error(L, "invalid bits count");
}
- e = BN_new();
-
- g_assert(BN_set_word(e, RSA_F4) == 1);
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
g_assert(pctx != NULL);
g_assert(EVP_PKEY_keygen_init(pctx) == 1);
g_assert(EVP_PKEY_CTX_set_rsa_keygen_bits(pctx, bits) == 1);
- g_assert(EVP_PKEY_CTX_set1_rsa_keygen_pubexp(pctx, e) == 1);
-
g_assert(EVP_PKEY_keygen(pctx, &pkey) == 1);
g_assert(pkey != NULL);
@@ -824,7 +818,6 @@ lua_rsa_keypair(lua_State *L)
EVP_PKEY_free(pkey);
EVP_PKEY_CTX_free(pctx);
- BN_free(e);
return 2;
}