aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2019-03-20 13:10:44 -0700
committerDavid Woodhouse <dwmw2@infradead.org>2019-03-20 13:10:44 -0700
commitefd9fba68189c70c2a48d9726b25df25ba87fcd0 (patch)
tree5be5e0950f88ba88eab71f8a8438660b802a3771
parent7550f62d079477413590ac79281159dbbde341b7 (diff)
openssl: if cert type is ENG and no key specified, key is ENG too
Fixes #3692 Closes #3692
-rw-r--r--lib/vtls/openssl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 186ee34e5..eff5c2106 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -838,15 +838,15 @@ int cert_stuff(struct connectdata *conn,
return 0;
}
- file_type = do_file_type(key_type);
+ if(!key_file)
+ key_file = cert_file;
+ else
+ file_type = do_file_type(key_type);
switch(file_type) {
case SSL_FILETYPE_PEM:
if(cert_done)
break;
- if(!key_file)
- /* cert & key can only be in PEM case in the same file */
- key_file = cert_file;
/* FALLTHROUGH */
case SSL_FILETYPE_ASN1:
if(SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type) != 1) {