Skip to content
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

Missing Error Check in function SSL_CTX_use_PrivateKey() #225

Closed
lc3412 opened this issue Sep 25, 2018 · 1 comment
Closed

Missing Error Check in function SSL_CTX_use_PrivateKey() #225

lc3412 opened this issue Sep 25, 2018 · 1 comment
Assignees
Milestone

Comments

@lc3412
Copy link

lc3412 commented Sep 25, 2018

Function SSL_CTX_use_PrivateKey() returns 1 on success. Otherwise need to check out the error stack to find out the reason. However , the return value of function SSL_CTX_use_PrivateKey() is not checked on line 770. See the following code:

line: 770

sslsplit/pxyconn.c

Lines 770 to 775 in 19a16bd

SSL_CTX_use_PrivateKey(sslctx, key);
for (int i = 0; i < sk_X509_num(chain); i++) {
X509 *c = sk_X509_value(chain, i);
ssl_x509_refcount_inc(c); /* next call consumes a reference */
SSL_CTX_add_extra_chain_cert(sslctx, c);
}

=================================================================================

We find the return value of this call been checked in the same file
Such as,
line: 1150

sslsplit/pxyconn.c

Lines 1150 to 1151 in 19a16bd

if (!SSL_CTX_use_PrivateKey(sslctx, ctx->opts->clientkey))
log_dbg_printf("loading client key failed");

Chi Li, Zuxing Gu, Jiecheng Wu

@droe droe self-assigned this Sep 25, 2018
droe added a commit that referenced this issue Sep 25, 2018
@droe droe added this to the 0.5.4 milestone Sep 25, 2018
@droe droe closed this as completed Sep 25, 2018
@droe
Copy link
Owner

droe commented Sep 25, 2018

Thank you for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants