| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include "testlib/s2n_testlib.h" |
| 17 |
#include "tls/s2n_connection.h" |
| 18 |
#include "utils/s2n_bitmap.h" |
| 19 |
|
| 20 |
const s2n_parsed_extension EMPTY_PARSED_EXTENSIONS[S2N_PARSED_EXTENSIONS_COUNT] = { 0 }; |
| 21 |
|
| 22 |
int s2n_connection_allow_all_response_extensions(struct s2n_connection *conn) |
| 23 |
{ |
| 24 |
POSIX_CHECKED_MEMSET(&conn->extension_requests_received, 0xFF, S2N_SUPPORTED_EXTENSIONS_BITFIELD_LEN); |
| 25 |
POSIX_CHECKED_MEMSET(&conn->extension_requests_sent, 0xFF, S2N_SUPPORTED_EXTENSIONS_BITFIELD_LEN); |
| 26 |
return S2N_SUCCESS; |
| 27 |
} |
| 28 |
|
| 29 |
int s2n_connection_mark_extension_received(struct s2n_connection *conn, uint16_t iana_value) |
| 30 |
{ |
| 31 |
s2n_extension_type_id extension_id = s2n_unsupported_extension; |
| 32 |
POSIX_GUARD(s2n_extension_supported_iana_value_to_id(iana_value, &extension_id)); |
| 33 |
S2N_CBIT_SET(conn->extension_requests_received, extension_id); |
| 34 |
S2N_CBIT_SET(conn->extension_responses_received, extension_id); |
| 35 |
return S2N_SUCCESS; |
| 36 |
} |
| 37 |
|
| 38 |
int s2n_connection_allow_response_extension(struct s2n_connection *conn, uint16_t iana_value) |
| 39 |
{ |
| 40 |
s2n_extension_type_id extension_id = s2n_unsupported_extension; |
| 41 |
POSIX_GUARD(s2n_extension_supported_iana_value_to_id(iana_value, &extension_id)); |
| 42 |
S2N_CBIT_SET(conn->extension_requests_sent, extension_id); |
| 43 |
S2N_CBIT_SET(conn->extension_requests_received, extension_id); |
| 44 |
return S2N_SUCCESS; |
| 45 |
} |