Skip to content

Commit

Permalink
tls: removed useless checks
Browse files Browse the repository at this point in the history
(cherry picked from commit 590c8d9)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent fcaa84b commit 726d726
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
21 changes: 9 additions & 12 deletions src/modules/tls/tls_domain.c
Expand Up @@ -1086,29 +1086,26 @@ static int fix_domain(tls_domain_t* d, tls_domain_t* def)
*/
static int passwd_cb(char *buf, int size, int rwflag, void *filename)
{
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
UI *ui;
const char *prompt;
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
UI *ui;
const char *prompt;

ui = UI_new();
if (ui == NULL)
if(ui == NULL)
goto err;

prompt = UI_construct_prompt(ui, "passphrase", filename);
UI_add_input_string(ui, prompt, 0, buf, 0, size - 1);
UI_process(ui);
UI_free(ui);
return strlen(buf);
err:

err:
ERR("passwd_cb: Error in passwd_cb\n");
if (ui) {
UI_free(ui);
}
return 0;

#else
if (des_read_pw_string(buf, size-1, "Enter Private Key password:", 0)) {
if(des_read_pw_string(buf, size - 1, "Enter Private Key password:", 0)) {
ERR("Error in passwd_cb\n");
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion src/modules/tls/tls_select.c
Expand Up @@ -461,7 +461,6 @@ static int check_cert(str* res, int* ires, int local, int err, sip_msg_t* msg)
return 0;

error:
if (cert) X509_free(cert);
if (c) tcpconn_put(c);
return -1;
}
Expand Down

0 comments on commit 726d726

Please sign in to comment.