| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <utils/s2n_socket.h> |
| 10 |
#include <cbmc_proof/make_common_datastructures.h> |
| 11 |
|
| 12 |
#include <assert.h> |
| 13 |
|
| 14 |
void s2n_socket_write_harness() |
| 15 |
{ |
| 16 |
|
| 17 |
void *io_context = cbmc_allocate_s2n_socket_write_io_context(); |
| 18 |
const uint8_t *buf = malloc(sizeof(*buf)); |
| 19 |
uint32_t len; |
| 20 |
if (io_context != NULL) { |
| 21 |
((struct s2n_socket_write_io_context*) io_context)->fd; |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
int result = s2n_socket_write(io_context, buf, len); |
| 26 |
|
| 27 |
|
| 28 |
assert(S2N_IMPLIES(result == S2N_SUCCESS, io_context != NULL)); |
| 29 |
assert(S2N_IMPLIES(io_context == NULL, result != S2N_SUCCESS)); |
| 30 |
} |