PR: 2658
[openssl.git] / ssl / d1_clnt.c
index 8a0d6fc07c0fda5fbfb8d257e9140aa5fc579f08..1b518d981ea0a2671e65ff51574ce0282f45eba0 100644 (file)
@@ -176,6 +176,19 @@ int dtls1_connect(SSL *s)
        BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE, s->in_handshake, NULL);
 #endif
 
+#ifndef OPENSSL_NO_HEARTBEATS
+       /* If we're awaiting a HeartbeatResponse, pretend we
+        * already got and don't await it anymore, because
+        * Heartbeats don't make sense during handshakes anyway.
+        */
+       if (s->tlsext_hb_pending)
+               {
+               dtls1_stop_timer(s);
+               s->tlsext_hb_pending = 0;
+               s->tlsext_hb_seq++;
+               }
+#endif
+
        for (;;)
                {
                state=s->state;