Debian Codegraph @

crt/s2n/tests/cbmc/proofs/s2n_socket_quickack/s2n_socket_quickack_harness.c

raw symbols SCIP
1 /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. */
2 /* SPDX-License-Identifier: Apache-2.0 */
3
4 /**
5 * @file s2n_socket_quickack_harness.c
6 * @brief Implements the proof harness for s2n_socket_quickack function.
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_quickack_harness()
15 {
16 /* Non-deterministic inputs. */
17 struct s2n_connection *s2n_connection = malloc(sizeof(*s2n_connection));
18 if (s2n_connection != NULL) {
19 s2n_connection->recv_io_context = cbmc_allocate_s2n_socket_read_io_context();
20 }
21
22 /* Operation under verification. */
23 int result = s2n_socket_quickack(s2n_connection);
24
25 /* Post-condition. */
26 assert(S2N_IMPLIES(result == S2N_SUCCESS, (!s2n_connection->managed_recv_io) || (s2n_connection->recv_io_context) != NULL));
27 }