diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2016-08-30 15:26:27 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-09-02 15:41:13 +0200 |
commit | 9eec15db0f1d5d9c1e3c2bbcd61bbedaa7f12c85 (patch) | |
tree | 99b72b4cda895469e1fefd579cb5b7d7716a6b21 /tests/mini-dtls-record.c | |
parent | 26ab59400cf501c502354aea586155fbf2b5b964 (diff) | |
download | gnutls-9eec15db0f1d5d9c1e3c2bbcd61bbedaa7f12c85.tar.gz |
Import DTLS sliding window validation from OpenConnect ESP code
In this implementation, the end of the sliding window is always advanced
to the latest received packet, and we accept up to 64 packets before
that one. We no longer refuse to accept packets because they are
*too* far ahead of what we've already seen.
Some of the test cases are fixed up accordingly.
This matches the code in OpenConnect esp-seqno.c at commit 314ac65.
Diffstat (limited to 'tests/mini-dtls-record.c')
-rw-r--r-- | tests/mini-dtls-record.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/mini-dtls-record.c b/tests/mini-dtls-record.c index 8d32d8f3af..63bba89aaf 100644 --- a/tests/mini-dtls-record.c +++ b/tests/mini-dtls-record.c @@ -163,7 +163,7 @@ static ssize_t n_push(gnutls_transport_ptr_t tr, const void *data, size_t len) /* The first five messages are handshake. Thus corresponds to msg_seq+5 */ static int recv_msg_seq[] = - { 1, 2, 3, 4, 5, 6, 12, 28, 8, 9, 10, 11, 13, 15, 16, 14, 18, 20, + { 1, 2, 3, 4, 5, 6, 12, 28, 7, 8, 9, 10, 11, 13, 15, 16, 14, 18, 20, 19, 21, 22, 23, 25, 24, 26, 27, 29, 30, 31, 33, 32, 34, 35, 38, 36, 37, -1 }; @@ -248,7 +248,6 @@ static void client(int fd) fail("received message sequence differs\n"); terminate(); } - if (((uint32_t)recv_msg_seq[current]) != useq) { fail("received message sequence differs (current: %u, got: %u, expected: %u)\n", (unsigned)current, (unsigned)useq, (unsigned)recv_msg_seq[current]); |