Fix flaw if 'Server Key exchange message' is omitted from a TLS
authorMark J. Cox <mark@openssl.org>
Wed, 28 May 2008 07:29:27 +0000 (07:29 +0000)
committerMark J. Cox <mark@openssl.org>
Wed, 28 May 2008 07:29:27 +0000 (07:29 +0000)
handshake which could lead to a cilent crash as found using the
Codenomicon TLS test suite (CVE-2008-1672)

Reviewed by: openssl-security@openssl.org

Obtained from: mark@awe.com

CHANGES
ssl/s3_clnt.c

diff --git a/CHANGES b/CHANGES
index 9d4d7ee16c42a0d9d83396d68af6c0c0744f1d5c..be6883635bd035460355f304f9bd3fca7f1a4460 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,11 @@
 
  Changes between 0.9.8g and 0.9.8h  [xx XXX xxxx]
 
+  *) Fix flaw if 'Server Key exchange message' is omitted from a TLS
+     handshake which could lead to a cilent crash as found using the
+     Codenomicon TLS test suite (CVE-2008-1672) 
+     [Steve Henson, Mark Cox]
+
   *) Fix double free in TLS server name extensions which could lead to
      a remote crash found by Codenomicon TLS test suite (CVE-2008-0891) 
      [Joe Orton]
index 648488b0636963e4185dbb711ef61756ff47c423..f6864cdc50ad7c74ad4c7f2d290cb53e9bf0a8b8 100644 (file)
@@ -2061,6 +2061,13 @@ int ssl3_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_SSL3_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