diff options
author | Matt Caswell <matt@openssl.org> | 2014-12-03 11:15:40 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-12-15 21:29:49 +0000 |
commit | 9d410579a782262c1a372bea80475ddee523985d (patch) | |
tree | 27e6517482997f71b912989882e1b19caed45e2f /ssl | |
parent | 4f90ef0c5bf46d927b1bd1ce54223d36852a4f3a (diff) |
Checkout return value of dtls1_output_cert_chain
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 9beb948c0dae6056caddf46a9aa099e18905d184)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/d1_clnt.c | 6 | ||||
-rw-r--r-- | ssl/d1_srvr.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index d8cf92686c..0fea8659ac 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -1548,6 +1548,12 @@ int dtls1_send_client_certificate(SSL *s) s->state=SSL3_ST_CW_CERT_D; l=dtls1_output_cert_chain(s, (s->s3->tmp.cert_req == 2)?NULL:s->cert->key->x509); + if (!l) + { + SSLerr(SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE, ERR_R_INTERNAL_ERROR); + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INTERNAL_ERROR); + return 0; + } s->init_num=(int)l; s->init_off=0; diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index a14fb43138..f52c735a5b 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -1446,6 +1446,11 @@ int dtls1_send_server_certificate(SSL *s) } l=dtls1_output_cert_chain(s,x); + if (!l) + { + SSLerr(SSL_F_DTLS1_SEND_SERVER_CERTIFICATE,ERR_R_INTERNAL_ERROR); + return(0); + } s->state=SSL3_ST_SW_CERT_B; s->init_num=(int)l; s->init_off=0; |