OpenSSL SSL_CTX_set_tmp_dh memory leak
up vote
0
down vote
favorite
I need some clarification on this example taken from the OpenSSL documentation https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_tmp_dh.html
...
SSL_CTX ctx = SSL_CTX_new();
...
/* Set up ephemeral DH parameters. */
DH *dh_2048 = NULL;
FILE *paramfile;
paramfile = fopen("dh_param_2048.pem", "r");
if (paramfile)
dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
fclose(paramfile);
else
/* Error. */
if (dh_2048 == NULL)
/* Error. */
if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1)
/* Error. */
...
Who is responsible to free the memory allocated for the DH parameter?
Do I need to call DH_free(dh_2048) after the SSL_CTX is destroyed or if SSL_CTX_set_tmp_dh returns an error?
c openssl
add a comment |
up vote
0
down vote
favorite
I need some clarification on this example taken from the OpenSSL documentation https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_tmp_dh.html
...
SSL_CTX ctx = SSL_CTX_new();
...
/* Set up ephemeral DH parameters. */
DH *dh_2048 = NULL;
FILE *paramfile;
paramfile = fopen("dh_param_2048.pem", "r");
if (paramfile)
dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
fclose(paramfile);
else
/* Error. */
if (dh_2048 == NULL)
/* Error. */
if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1)
/* Error. */
...
Who is responsible to free the memory allocated for the DH parameter?
Do I need to call DH_free(dh_2048) after the SSL_CTX is destroyed or if SSL_CTX_set_tmp_dh returns an error?
c openssl
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I need some clarification on this example taken from the OpenSSL documentation https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_tmp_dh.html
...
SSL_CTX ctx = SSL_CTX_new();
...
/* Set up ephemeral DH parameters. */
DH *dh_2048 = NULL;
FILE *paramfile;
paramfile = fopen("dh_param_2048.pem", "r");
if (paramfile)
dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
fclose(paramfile);
else
/* Error. */
if (dh_2048 == NULL)
/* Error. */
if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1)
/* Error. */
...
Who is responsible to free the memory allocated for the DH parameter?
Do I need to call DH_free(dh_2048) after the SSL_CTX is destroyed or if SSL_CTX_set_tmp_dh returns an error?
c openssl
I need some clarification on this example taken from the OpenSSL documentation https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_tmp_dh.html
...
SSL_CTX ctx = SSL_CTX_new();
...
/* Set up ephemeral DH parameters. */
DH *dh_2048 = NULL;
FILE *paramfile;
paramfile = fopen("dh_param_2048.pem", "r");
if (paramfile)
dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
fclose(paramfile);
else
/* Error. */
if (dh_2048 == NULL)
/* Error. */
if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1)
/* Error. */
...
Who is responsible to free the memory allocated for the DH parameter?
Do I need to call DH_free(dh_2048) after the SSL_CTX is destroyed or if SSL_CTX_set_tmp_dh returns an error?
c openssl
c openssl
asked Nov 11 at 9:14
fergtm
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53247315%2fopenssl-ssl-ctx-set-tmp-dh-memory-leak%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown