| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include <stdio.h> |
| 17 |
#include <string.h> |
| 18 |
|
| 19 |
#include "api/s2n.h" |
| 20 |
#include "s2n_test.h" |
| 21 |
#include "stuffer/s2n_stuffer.h" |
| 22 |
#include "testlib/s2n_testlib.h" |
| 23 |
#include "tls/extensions/s2n_server_signature_algorithms.h" |
| 24 |
#include "tls/extensions/s2n_server_supported_versions.h" |
| 25 |
#include "tls/s2n_tls.h" |
| 26 |
#include "tls/s2n_tls13.h" |
| 27 |
#include "utils/s2n_safety.h" |
| 28 |
|
| 29 |
int main(int argc, char **argv) |
| 30 |
{ |
| 31 |
BEGIN_TEST(); |
| 32 |
EXPECT_SUCCESS(s2n_enable_tls13_in_test()); |
| 33 |
|
| 34 |
|
| 35 |
{ |
| 36 |
struct s2n_connection *conn = NULL; |
| 37 |
EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_CLIENT)); |
| 38 |
conn->actual_protocol_version = S2N_TLS13; |
| 39 |
|
| 40 |
EXPECT_EQUAL(conn->handshake_params.peer_sig_scheme_list.len, 0); |
| 41 |
EXPECT_SUCCESS(s2n_tls13_cert_req_send(conn)); |
| 42 |
EXPECT_SUCCESS(s2n_tls13_cert_req_recv(conn)); |
| 43 |
EXPECT_NOT_EQUAL(conn->handshake_params.peer_sig_scheme_list.len, 0); |
| 44 |
|
| 45 |
EXPECT_SUCCESS(s2n_connection_free(conn)); |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
{ |
| 50 |
struct s2n_connection *client_conn = NULL; |
| 51 |
EXPECT_NOT_NULL(client_conn = s2n_connection_new(S2N_CLIENT)); |
| 52 |
client_conn->actual_protocol_version = S2N_TLS13; |
| 53 |
|
| 54 |
|
| 55 |
EXPECT_SUCCESS(s2n_stuffer_write_uint8(&client_conn->handshake.io, 0)); |
| 56 |
EXPECT_SUCCESS(s2n_extension_list_send(S2N_EXTENSION_LIST_EMPTY, client_conn, &client_conn->handshake.io)); |
| 57 |
|
| 58 |
EXPECT_FAILURE_WITH_ERRNO(s2n_tls13_cert_req_recv(client_conn), S2N_ERR_MISSING_EXTENSION); |
| 59 |
|
| 60 |
EXPECT_SUCCESS(s2n_connection_free(client_conn)); |
| 61 |
}; |
| 62 |
|
| 63 |
EXPECT_SUCCESS(s2n_disable_tls13_in_test()); |
| 64 |
END_TEST(); |
| 65 |
|
| 66 |
return 0; |
| 67 |
} |