-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish memory leak #27
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1229,13 +1229,21 @@ __attribute__((noreturn)) static void *daemon_close_notify_thread(void *_close_n | |
_exit(0); | ||
} | ||
|
||
#ifdef NEVERBLEED_OPAQUE_RSA_METHOD | ||
static int (*rsa_finish)(RSA *rsa); | ||
#endif | ||
|
||
static int priv_rsa_finish(RSA *rsa) | ||
{ | ||
struct st_neverbleed_rsa_exdata_t *exdata; | ||
struct st_neverbleed_thread_data_t *thdata; | ||
|
||
get_privsep_data(rsa, &exdata, &thdata); | ||
|
||
#ifdef NEVERBLEED_OPAQUE_RSA_METHOD | ||
rsa_finish(rsa); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
#endif | ||
|
||
struct expbuf_t buf = {NULL}; | ||
size_t ret; | ||
|
||
|
@@ -1431,6 +1439,7 @@ int neverbleed_init(neverbleed_t *nb, char *errbuf) | |
#ifdef NEVERBLEED_OPAQUE_RSA_METHOD | ||
rsa_default_method = RSA_PKCS1_OpenSSL(); | ||
rsa_method = RSA_meth_dup(rsa_default_method); | ||
rsa_finish = RSA_meth_get_finish(rsa_method); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may miss some context, but I don't know why this and other changes are only for newer OpenSSL since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that, while getting the |
||
|
||
RSA_meth_set1_name(rsa_method, "privsep RSA method"); | ||
RSA_meth_set_priv_enc(rsa_method, priv_enc_proxy); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make the change in
neverbleed_init
also for!NEVERBLEED_OPAQUE_RSA_METHOD
, this declaration should be moved out of#ifdef
.