diff options
author | Matt Caswell <matt@openssl.org> | 2014-03-18 14:19:22 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-12-15 21:29:49 +0000 |
commit | 4f90ef0c5bf46d927b1bd1ce54223d36852a4f3a (patch) | |
tree | ccea17294f4490ae5716faf3741e82a01da95ebb | |
parent | eae2bb2f1f5347c0bd305026fd3c222e0ccd69e2 (diff) |
Check return value of ssl3_output_cert_chain
Based on commit 66f96fe2d519147097c118d4bf60704c69ed0635 by Steve Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit ce5ddefc4394a0ae6c79efaffe08cf47ac659ea0)
-rw-r--r-- | ssl/s3_clnt.c | 6 | ||||
-rw-r--r-- | ssl/s3_srvr.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 89dc06e5f8..e614f9693e 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -2962,6 +2962,12 @@ int ssl3_send_client_certificate(SSL *s) s->state=SSL3_ST_CW_CERT_D; l=ssl3_output_cert_chain(s, (s->s3->tmp.cert_req == 2)?NULL:s->cert->key->x509); + if (!l) + { + SSLerr(SSL_F_SSL3_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/s3_srvr.c b/ssl/s3_srvr.c index 546d633e34..4573ec8b74 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -3084,6 +3084,11 @@ int ssl3_send_server_certificate(SSL *s) } l=ssl3_output_cert_chain(s,x); + if (!l) + { + SSLerr(SSL_F_SSL3_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; |