Skip to content

Commit

Permalink
Check return value of ssl3_output_cert_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
snhenson committed Mar 28, 2014
1 parent 8b8e5be commit 66f96fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions ssl/s3_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3380,8 +3380,13 @@ int ssl3_send_client_certificate(SSL *s)
if (s->state == SSL3_ST_CW_CERT_C)
{
s->state=SSL3_ST_CW_CERT_D;
ssl3_output_cert_chain(s,
(s->s3->tmp.cert_req == 2)?NULL:s->cert->key);
if (!ssl3_output_cert_chain(s,
(s->s3->tmp.cert_req == 2)?NULL:s->cert->key))
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_CERTIFICATE, ERR_R_INTERNAL_ERROR);
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INTERNAL_ERROR);
return 0;
}
}
/* SSL3_ST_CW_CERT_D */
return ssl_do_write(s);
Expand Down
6 changes: 5 additions & 1 deletion ssl/s3_srvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3476,7 +3476,11 @@ int ssl3_send_server_certificate(SSL *s)
}
}

ssl3_output_cert_chain(s,cpk);
if (!ssl3_output_cert_chain(s,cpk))
{
SSLerr(SSL_F_SSL3_SEND_SERVER_CERTIFICATE,ERR_R_INTERNAL_ERROR);
return(0);
}
s->state=SSL3_ST_SW_CERT_B;
}

Expand Down

0 comments on commit 66f96fe

Please sign in to comment.