aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_rsa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lua/lua_rsa.c b/src/lua/lua_rsa.c
index 4b9aa0354..5f7db606f 100644
--- a/src/lua/lua_rsa.c
+++ b/src/lua/lua_rsa.c
@@ -716,6 +716,8 @@ lua_rsa_verify_memory(lua_State *L)
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL);
g_assert(pctx != NULL);
g_assert(EVP_PKEY_verify_init(pctx) == 1);
+ g_assert(EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PADDING) == 1);
+ g_assert(EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha256()) == 1);
ret = EVP_PKEY_verify(pctx, signature->str, signature->len, data, sz);
@@ -766,6 +768,8 @@ lua_rsa_sign_memory(lua_State *L)
g_assert(pctx != NULL);
g_assert(EVP_PKEY_sign_init(pctx) == 1);
+ g_assert(EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PADDING) == 1);
+ g_assert(EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha256()) == 1);
size_t slen = signature->allocated;
ret = EVP_PKEY_sign(pctx, signature->str, &slen, data, sz);