diff -up openssl-fips-0.9.8e/ssl/d1_clnt.c.adh-dos openssl-fips-0.9.8e/ssl/d1_clnt.c --- openssl-fips-0.9.8e/ssl/d1_clnt.c.adh-dos 2014-08-08 10:53:54.843106757 +0200 +++ openssl-fips-0.9.8e/ssl/d1_clnt.c 2014-08-08 11:45:44.900665548 +0200 @@ -727,6 +727,13 @@ int dtls1_send_client_key_exchange(SSL * RSA *rsa; unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH]; + if (s->session->sess_cert == NULL) + { + /* We should always have a server certificate with SSL_kRSA. */ + SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); + goto err; + } + if (s->session->sess_cert->peer_rsa_tmp != NULL) rsa=s->session->sess_cert->peer_rsa_tmp; else @@ -917,6 +924,13 @@ int dtls1_send_client_key_exchange(SSL * { DH *dh_srvr,*dh_clnt; + if (s->session->sess_cert == NULL) + { + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE); + SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE); + goto err; + } + if (s->session->sess_cert->peer_dh_tmp != NULL) dh_srvr=s->session->sess_cert->peer_dh_tmp; else @@ -1158,5 +1172,3 @@ int dtls1_send_client_certificate(SSL *s /* SSL3_ST_CW_CERT_D */ return(dtls1_do_write(s,SSL3_RT_HANDSHAKE)); } - - diff -up openssl-fips-0.9.8e/ssl/s3_clnt.c.adh-dos openssl-fips-0.9.8e/ssl/s3_clnt.c --- openssl-fips-0.9.8e/ssl/s3_clnt.c.adh-dos 2014-08-08 10:53:54.897107025 +0200 +++ openssl-fips-0.9.8e/ssl/s3_clnt.c 2014-08-08 11:45:44.901665552 +0200 @@ -1675,6 +1675,13 @@ int ssl3_send_client_key_exchange(SSL *s RSA *rsa; unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH]; + if (s->session->sess_cert == NULL) + { + /* We should always have a server certificate with SSL_kRSA. */ + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); + goto err; + } + if (s->session->sess_cert->peer_rsa_tmp != NULL) rsa=s->session->sess_cert->peer_rsa_tmp; else