Skip to content

Commit

Permalink
Merge branch 'main' into mlkem-part-4
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Oct 16, 2024
2 parents b7e7aef + 66e90d7 commit 6d1e888
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/testlib/s2n_connection_test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,12 @@ int s2n_io_pair_close(struct s2n_test_io_pair *io_pair)

int s2n_io_pair_close_one_end(struct s2n_test_io_pair *io_pair, int mode_to_close)
{
if (mode_to_close == S2N_CLIENT) {
if (mode_to_close == S2N_CLIENT && io_pair->client != S2N_CLOSED_FD) {
POSIX_GUARD(close(io_pair->client));
} else if (mode_to_close == S2N_SERVER) {
io_pair->client = S2N_CLOSED_FD;
} else if (mode_to_close == S2N_SERVER && io_pair->server != S2N_CLOSED_FD) {
POSIX_GUARD(close(io_pair->server));
io_pair->server = S2N_CLOSED_FD;
}
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/testlib/s2n_testlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "stuffer/s2n_stuffer.h"
#include "tls/s2n_connection.h"

#define S2N_CLOSED_FD -1

extern const struct s2n_ecc_preferences ecc_preferences_for_retry;
extern const struct s2n_security_policy security_policy_test_tls13_retry;

Expand Down

0 comments on commit 6d1e888

Please sign in to comment.