From d8138e91d0613ebb373fe4c2beb39e53df43f59d Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 7 Nov 2014 02:49:34 -0500 Subject: [PATCH] Keep retransmit window size architecture-independent. Parameters like these should not change between 32-bit and 64-bit. 64 is also the value recommended in RFC 6347, section 4.1.2.6. Document those fields while I'm here. Change-Id: I8481ee0765ff3d261a96a2e1a53b6ad6695b2d42 Reviewed-on: https://boringssl-review.googlesource.com/2222 Reviewed-by: Adam Langley --- include/openssl/dtls1.h | 11 ++++++----- ssl/d1_pkt.c | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/openssl/dtls1.h b/include/openssl/dtls1.h index 2069aedb..ac097ce7 100644 --- a/include/openssl/dtls1.h +++ b/include/openssl/dtls1.h @@ -103,11 +103,12 @@ typedef struct timeval OPENSSL_timeval; typedef struct dtls1_bitmap_st { - unsigned long map; /* track 32 packets on 32-bit systems - and 64 - on 64-bit systems */ - unsigned char max_seq_num[8]; /* max record number seen so far, - 64-bit value in big-endian - encoding */ + /* map is a bit mask of the last 64 sequence numbers. Bit + * |1<= sizeof(bitmap->map)*8) return 0; /* stale, outside the window */ - else if (bitmap->map & (1UL<map & (((uint64_t) 1) << shift)) return 0; /* record previously received */ memcpy (s->s3->rrec.seq_num,seq,8); @@ -1479,7 +1479,7 @@ static void dtls1_record_bitmap_update(SSL *s, DTLS1_BITMAP *bitmap) else { shift = -cmp; if (shift < sizeof(bitmap->map)*8) - bitmap->map |= 1UL<map |= ((uint64_t) 1) << shift; } }