return (int)ret;
}
-static int dtls_record_replay_check(OSSL_RECORD_LAYER *rl, DTLS1_BITMAP *bitmap)
+static int dtls_record_replay_check(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
{
int cmp;
unsigned int shift;
shift = -cmp;
if (shift >= sizeof(bitmap->map) * 8)
return 0; /* stale, outside the window */
- else if (bitmap->map & (1UL << shift))
+ else if (bitmap->map & ((uint64_t)1 << shift))
return 0; /* record previously received */
SSL3_RECORD_set_seq_num(&rl->rrec[0], seq);
}
static void dtls_record_bitmap_update(OSSL_RECORD_LAYER *rl,
- DTLS1_BITMAP *bitmap)
+ DTLS_BITMAP *bitmap)
{
int cmp;
unsigned int shift;
} else {
shift = -cmp;
if (shift < sizeof(bitmap->map) * 8)
- bitmap->map |= 1UL << shift;
+ bitmap->map |= (uint64_t)1 << shift;
}
}
-static DTLS1_BITMAP *dtls_get_bitmap(OSSL_RECORD_LAYER *rl, SSL3_RECORD *rr,
- unsigned int *is_next_epoch)
+static DTLS_BITMAP *dtls_get_bitmap(OSSL_RECORD_LAYER *rl, SSL3_RECORD *rr,
+ unsigned int *is_next_epoch)
{
*is_next_epoch = 0;
rl->in_init = in_init;
}
-static int dtls_process_record(OSSL_RECORD_LAYER *rl, DTLS1_BITMAP *bitmap)
+static int dtls_process_record(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
{
int i;
int enc_err;
SSL3_RECORD *rr;
unsigned char *p = NULL;
unsigned short version;
- DTLS1_BITMAP *bitmap;
+ DTLS_BITMAP *bitmap;
unsigned int is_next_epoch;
rl->num_recs = 0;
#include "../../ssl_local.h"
#include "../record_local.h"
+typedef struct dtls_bitmap_st {
+ /* Track 64 packets */
+ uint64_t map;
+ /* Max record number seen so far, 64-bit value in big-endian encoding */
+ unsigned char max_seq_num[SEQ_NUM_SIZE];
+} DTLS_BITMAP;
+
/* Protocol version specific function pointers */
struct record_functions_st
{
record_pqueue processed_rcds;
/* records being received in the current epoch */
- DTLS1_BITMAP bitmap;
+ DTLS_BITMAP bitmap;
/* renegotiation starts a new set of sequence numbers */
- DTLS1_BITMAP next_bitmap;
+ DTLS_BITMAP next_bitmap;
/*
* Whether we are currently in a hanshake or not. Only maintained for DTLS
#endif
} TLS_RECORD;
-typedef struct dtls1_bitmap_st {
- /* Track 32 packets on 32-bit systems and 64 - on 64-bit systems */
- unsigned long map;
- /* Max record number seen so far, 64-bit value in big-endian encoding */
- unsigned char max_seq_num[SEQ_NUM_SIZE];
-} DTLS1_BITMAP;
-
typedef struct record_pqueue_st {
uint16_t epoch;
struct pqueue_st *q;