summaryrefslogtreecommitdiffstats
path: root/apps/s_cb.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-03-06 14:39:46 +0000
committerMatt Caswell <matt@openssl.org>2015-03-23 15:23:18 +0000
commitac59d70553723cd8c7c1558071a2e1672d80daef (patch)
treea35c6bddb4f86bcbcc1f4f6acfb38acd3b43a72c /apps/s_cb.c
parent69f682374868ba2b19a8aeada496bf03dbb037cf (diff)
apps return value checks
Ensure that all libssl functions called from within the apps have their return values checked where appropriate. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/s_cb.c')
-rw-r--r--apps/s_cb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c
index 8a66c9a7dc..8bc4b81710 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -1181,8 +1181,10 @@ static int set_cert_cb(SSL *ssl, void *arg)
print_chain_flags(bio_err, ssl, rv);
if (rv & CERT_PKEY_VALID) {
- SSL_use_certificate(ssl, exc->cert);
- SSL_use_PrivateKey(ssl, exc->key);
+ if(!SSL_use_certificate(ssl, exc->cert)
+ || !SSL_use_PrivateKey(ssl, exc->key)) {
+ return 0;
+ }
/*
* NB: we wouldn't normally do this as it is not efficient
* building chains on each connection better to cache the chain