X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Frecord%2Frec_layer.h;h=e8dd3ff1f186f1391854f4bfc8a41202f5f5b45d;hp=19fe04870cbcd6f9fd6721eaac326f0ec21b7de2;hb=999005e49355d738a017fa300630864f832b6273;hpb=ab97b2cd4301074fd88fd2f13b8c79342593dae4 diff --git a/ssl/record/rec_layer.h b/ssl/record/rec_layer.h index 19fe04870c..e8dd3ff1f1 100644 --- a/ssl/record/rec_layer.h +++ b/ssl/record/rec_layer.h @@ -111,6 +111,19 @@ #include "../ssl_locl.h" +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 */ +} DTLS1_BITMAP; + + +typedef struct record_pqueue_st { + unsigned short epoch; + pqueue q; +} record_pqueue; + typedef struct record_layer_st { /* The parent SSL structure */ SSL *s; @@ -123,6 +136,10 @@ typedef struct record_layer_st { SSL3_BUFFER rbuf; /* write IO goes into here */ SSL3_BUFFER wbuf; + /* each decoded record goes in here */ + SSL3_RECORD rrec; + /* goes out from here */ + SSL3_RECORD wrec; } RECORD_LAYER; #define RECORD_LAYER_set_ssl(rl, s) ((rl)->s = (s)) @@ -130,3 +147,29 @@ typedef struct record_layer_st { #define RECORD_LAYER_get_read_ahead(rl) ((rl)->read_ahead) #define RECORD_LAYER_get_rbuf(rl) (&(rl)->rbuf) #define RECORD_LAYER_get_wbuf(rl) (&(rl)->wbuf) +#define RECORD_LAYER_get_rrec(rl) (&(rl)->rrec) +#define RECORD_LAYER_get_wrec(rl) (&(rl)->wrec) + +__owur int ssl23_read_bytes(SSL *s, int n); +__owur int ssl23_write_bytes(SSL *s); +__owur int ssl3_read_n(SSL *s, int n, int max, int extend); +__owur int ssl3_write_bytes(SSL *s, int type, const void *buf, int len); +__owur int do_ssl3_write(SSL *s, int type, const unsigned char *buf, + unsigned int len, int create_empty_fragment); +__owur int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, + unsigned int len); +__owur int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); +__owur int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); +int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); +__owur int do_dtls1_write(SSL *s, int type, const unsigned char *buf, + unsigned int len, int create_empty_fragement); +int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap); +void dtls1_record_bitmap_update(SSL *s, DTLS1_BITMAP *bitmap); +DTLS1_BITMAP *dtls1_get_bitmap(SSL *s, SSL3_RECORD *rr, + unsigned int *is_next_epoch); +int dtls1_process_buffered_records(SSL *s); +int dtls1_retrieve_buffered_record(SSL *s, record_pqueue *queue); +int dtls1_buffer_record(SSL *s, record_pqueue *q, + unsigned char *priority); +void dtls1_reset_seq_numbers(SSL *s, int rw); +