Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion RSA.xs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ _new_key_from_parameters(proto, n, e, d, p, q)
}
else if (!q)
{
q = BN_new();
THROW(q = BN_new());
THROW(BN_div(q, NULL, n, p, ctx));
}
#if OLD_CRUFTY_SSL_VERSION
Expand Down Expand Up @@ -684,8 +684,19 @@ _new_key_from_parameters(proto, n, e, d, p, q)
#else
THROW(RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp));
#endif
#endif
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
BN_clear_free(dmp1);
BN_clear_free(dmq1);
BN_clear_free(iqmp);
#endif
dmp1 = dmq1 = iqmp = NULL;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Koan-Bot did we miss freeing dmp1, dmq1 and iqmp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Koan-Bot shouldn't dmp1, dmq1 and iqmp be freed on any openssl version?

BN_CTX_free(ctx);
ctx = NULL;
BN_clear_free(p_minus_1);
p_minus_1 = NULL;
BN_clear_free(q_minus_1);
q_minus_1 = NULL;
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
OSSL_PARAM_BLD_free(params_build);
params_build = NULL;
Expand Down
Loading