diff options
author | marha <marha@users.sourceforge.net> | 2014-09-02 18:24:12 +0200 |
---|---|---|
committer | Mike DePaulo <mikedep333@gmail.com> | 2015-02-28 07:15:53 -0500 |
commit | 8fafe3481b134a4d368ba57e3698754a6a45c4c1 (patch) | |
tree | b617e841e1b5c0b234f7698331e5fb1be1c2332a /openssl/ssl/d1_clnt.c | |
parent | fe03d6aef6338e43593f164b09ae993bcd0ecbdd (diff) | |
download | vcxsrv-8fafe3481b134a4d368ba57e3698754a6a45c4c1.tar.gz vcxsrv-8fafe3481b134a4d368ba57e3698754a6a45c4c1.tar.bz2 vcxsrv-8fafe3481b134a4d368ba57e3698754a6a45c4c1.zip |
Upgrade openssl to version openssl-1.0.1i
Diffstat (limited to 'openssl/ssl/d1_clnt.c')
-rw-r--r-- | openssl/ssl/d1_clnt.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/openssl/ssl/d1_clnt.c b/openssl/ssl/d1_clnt.c index 48e5e06bd..fd6562c11 100644 --- a/openssl/ssl/d1_clnt.c +++ b/openssl/ssl/d1_clnt.c @@ -876,12 +876,18 @@ int dtls1_client_hello(SSL *s) *(p++)=0; /* Add the NULL method */ #ifndef OPENSSL_NO_TLSEXT + /* TLS extensions*/ + if (ssl_prepare_clienthello_tlsext(s) <= 0) + { + SSLerr(SSL_F_DTLS1_CLIENT_HELLO,SSL_R_CLIENTHELLO_TLSEXT); + goto err; + } if ((p = ssl_add_clienthello_tlsext(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH)) == NULL) { SSLerr(SSL_F_DTLS1_CLIENT_HELLO,ERR_R_INTERNAL_ERROR); goto err; } -#endif +#endif l=(p-d); d=buf; @@ -990,6 +996,13 @@ int dtls1_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_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 @@ -1180,6 +1193,13 @@ int dtls1_send_client_key_exchange(SSL *s) { 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 @@ -1239,6 +1259,13 @@ int dtls1_send_client_key_exchange(SSL *s) int ecdh_clnt_cert = 0; int field_size = 0; + 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; + } + /* Did we send out the client's * ECDH share for use in premaster * computation as part of client certificate? @@ -1714,5 +1741,3 @@ int dtls1_send_client_certificate(SSL *s) /* SSL3_ST_CW_CERT_D */ return(dtls1_do_write(s,SSL3_RT_HANDSHAKE)); } - - |