oops revert test code accidentally committed
[openssl.git] / ssl / d1_pkt.c
index 355d5ed9cdcbeedc59bbe83855cb02a77cbccecf..c9757e1d63f4c740c791248d1244253955150339 100644 (file)
@@ -534,7 +534,7 @@ int dtls1_get_record(SSL *s)
        int i,n;
        SSL3_RECORD *rr;
        SSL_SESSION *sess;
-       unsigned char *p;
+       unsigned char *p = NULL;
        unsigned short version;
        DTLS1_BITMAP *bitmap;
        unsigned int is_next_epoch;
@@ -648,8 +648,15 @@ again:
                goto again;   /* get another record */
                }
 
-       /* check whether this is a repeat, or aged record */
-       if ( ! dtls1_record_replay_check(s, bitmap))
+       /* Check whether this is a repeat, or aged record.
+        * Don't check if we're listening and this message is
+        * a ClientHello. They can look as if they're replayed,
+        * since they arrive from different connections and
+        * would be dropped unnecessarily.
+        */
+       if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
+               *p == SSL3_MT_CLIENT_HELLO) &&
+               !dtls1_record_replay_check(s, bitmap))
                {
                rr->length = 0;
                s->packet_length=0; /* dump this record */