Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
README | D | 12-May-2024 | 3.5 KiB | 75 | 63 | |
dtls1_bitmap.c | D | 12-May-2024 | 2.1 KiB | 79 | 57 | |
rec_layer_d1.c | D | 12-May-2024 | 33.9 KiB | 1,063 | 681 | |
rec_layer_s3.c | D | 12-May-2024 | 60.8 KiB | 1,780 | 1,171 | |
record.h | D | 12-May-2024 | 9.5 KiB | 237 | 130 | |
record_local.h | D | 12-May-2024 | 6 KiB | 117 | 84 | |
ssl3_buffer.c | D | 12-May-2024 | 4.6 KiB | 180 | 130 | |
ssl3_record.c | D | 12-May-2024 | 71.3 KiB | 2,064 | 1,376 | |
ssl3_record_tls13.c | D | 12-May-2024 | 6.6 KiB | 197 | 135 |
README
1Record Layer Design 2=================== 3 4This file provides some guidance on the thinking behind the design of the 5record layer code to aid future maintenance. 6 7The record layer is divided into a number of components. At the time of writing 8there are four: SSL3_RECORD, SSL3_BUFFER, DLTS1_BITMAP and RECORD_LAYER. Each 9of these components is defined by: 101) A struct definition of the same name as the component 112) A set of source files that define the functions for that component 123) A set of accessor macros 13 14All struct definitions are in record.h. The functions and macros are either 15defined in record.h or record_local.h dependent on whether they are intended to 16be private to the record layer, or whether they form part of the API to the rest 17of libssl. 18 19The source files map to components as follows: 20 21dtls1_bitmap.c -> DTLS1_BITMAP component 22ssl3_buffer.c -> SSL3_BUFFER component 23ssl3_record.c -> SSL3_RECORD component 24rec_layer_s3.c, rec_layer_d1.c -> RECORD_LAYER component 25 26The RECORD_LAYER component is a facade pattern, i.e. it provides a simplified 27interface to the record layer for the rest of libssl. The other 3 components are 28entirely private to the record layer and therefore should never be accessed 29directly by libssl. 30 31Any component can directly access its own members - they are private to that 32component, e.g. ssl3_buffer.c can access members of the SSL3_BUFFER struct 33without using a macro. No component can directly access the members of another 34component, e.g. ssl3_buffer cannot reach inside the RECORD_LAYER component to 35directly access its members. Instead components use accessor macros, so if code 36in ssl3_buffer.c wants to access the members of the RECORD_LAYER it uses the 37RECORD_LAYER_* macros. 38 39Conceptually it looks like this: 40 41 libssl 42 | 43---------------------------|-----record.h-------------------------------------- 44 | 45 _______V______________ 46 | | 47 | RECORD_LAYER | 48 | | 49 | rec_layer_s3.c | 50 | ^ | 51 | _________|__________ | 52 || || 53 || DTLS1_RECORD_LAYER || 54 || || 55 || rec_layer_d1.c || 56 ||____________________|| 57 |______________________| 58 record_local.h ^ ^ ^ 59 _________________| | |_________________ 60 | | | 61 _____V_________ ______V________ _______V________ 62 | | | | | | 63 | SSL3_BUFFER | | SSL3_RECORD | | DTLS1_BITMAP | 64 | |--->| | | | 65 | ssl3_buffer.c | | ssl3_record.c | | dtls1_bitmap.c | 66 |_______________| |_______________| |________________| 67 68 69The two RECORD_LAYER source files build on each other, i.e. 70the main one is rec_layer_s3.c which provides the core SSL/TLS layer. The second 71one is rec_layer_d1.c which builds off of the SSL/TLS code to provide DTLS 72specific capabilities. It uses some DTLS specific RECORD_LAYER component members 73which should only be accessed from rec_layer_d1.c. These are held in the 74DTLS1_RECORD_LAYER struct. 75