This commit was manufactured by cvs2svn to create branch
[oweals/openssl.git] / ssl / s3_pkt.c
index 63536754ce0637605a22053b6b6400d6e5291a37..3c56a86933ffd5d69b829362c30f30a0369d12da 100644 (file)
@@ -754,6 +754,8 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
                /* Need explicit part of IV for GCM mode */
                else if (mode == EVP_CIPH_GCM_MODE)
                        eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN;
+               else
+                       eivlen = 0;
                }
        else 
                eivlen = 0;
@@ -1068,6 +1070,19 @@ start:
                        dest = s->s3->alert_fragment;
                        dest_len = &s->s3->alert_fragment_len;
                        }
+#ifndef OPENSSL_NO_HEARTBEATS
+               else if (rr->type == TLS1_RT_HEARTBEAT)
+                       {
+                       tls1_process_heartbeat(s);
+
+                       /* Exit and notify application to read again */
+                       rr->length = 0;
+                       s->rwstate=SSL_READING;
+                       BIO_clear_retry_flags(SSL_get_rbio(s));
+                       BIO_set_retry_read(SSL_get_rbio(s));
+                       return(-1);
+                       }
+#endif
 
                if (dest_maxlen > 0)
                        {