summaryrefslogtreecommitdiffstats
path: root/apps/s_cb.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-11-17 16:30:51 +0000
committerDr. Stephen Henson <steve@openssl.org>2014-11-19 22:50:00 +0000
commit786370b1b09b919d9306f27336e13783e4fe3fd0 (patch)
tree212635954f0a44ce7cc3c026d2d9f29260423fe5 /apps/s_cb.c
parent56e8dc542bd693b2dccea8828b3d8e5fc6932d0c (diff)
Fix excert logic.
If no keyfile has been specified use the certificate file instead. Fix typo: we need to check the chain is not NULL, not the chain file. Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'apps/s_cb.c')
-rw-r--r--apps/s_cb.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c
index ed877af122..c6c721ebe1 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -1402,9 +1402,15 @@ int load_excert(SSL_EXCERT **pexc, BIO *err)
if (!exc->cert)
return 0;
if (exc->keyfile)
- exc->keyfile = exc->certfile;
- exc->key = load_key(err, exc->certfile, exc->certform, 0,
- NULL, NULL, "Server Certificate");
+ {
+ exc->key = load_key(err, exc->keyfile, exc->keyform,
+ 0, NULL, NULL, "Server Key");
+ }
+ else
+ {
+ exc->key = load_key(err, exc->certfile, exc->certform,
+ 0, NULL, NULL, "Server Key");
+ }
if (!exc->key)
return 0;
if (exc->chainfile)
@@ -1413,7 +1419,7 @@ int load_excert(SSL_EXCERT **pexc, BIO *err)
exc->chainfile, FORMAT_PEM,
NULL, NULL,
"Server Chain");
- if (!exc->chainfile)
+ if (!exc->chain)
return 0;
}
}