diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2014-11-17 16:30:51 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2014-11-19 22:52:56 +0000 |
commit | 764b6a3551919e3e98b5048891688c4a615291d7 (patch) | |
tree | e2673ff6fe8cb4b0cf17c5ffab699683f60b3fd2 /apps | |
parent | 3881d8106df732fc433d30446625dfa2396da42d (diff) | |
download | openssl-764b6a3551919e3e98b5048891688c4a615291d7.tar.gz |
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>
(cherry picked from commit 786370b1b09b919d9306f27336e13783e4fe3fd0)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_cb.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c index cf34e00a4c..e597eb360f 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -1407,9 +1407,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) @@ -1418,7 +1424,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; } } |