PR: 2658
[openssl.git] / ssl / d1_clnt.c
index 4ee48489579387c3c73a8665dc8cf7158f131401..bb1fd6ac0a8682c26306f9cc3e492cdce2c77b17 100644 (file)
@@ -177,6 +177,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;