@@ -1336,13 +1336,10 @@ static int s2n_handshake_handle_sslv2(struct s2n_connection *conn)
13361336 POSIX_GUARD (s2n_stuffer_wipe (& conn -> handshake .io ));
13371337
13381338 /* We're done with the record, wipe it */
1339- POSIX_GUARD (s2n_stuffer_wipe (& conn -> header_in ));
1340- POSIX_GUARD (s2n_stuffer_wipe (& conn -> in ));
1339+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
13411340
13421341 WITH_ERROR_BLINDING (conn , POSIX_GUARD (r ));
13431342
1344- conn -> in_status = ENCRYPTED ;
1345-
13461343 /* Advance the state machine */
13471344 POSIX_GUARD (s2n_advance_message (conn ));
13481345
@@ -1360,15 +1357,6 @@ static int s2n_try_delete_session_cache(struct s2n_connection *conn)
13601357 return S2N_SUCCESS ;
13611358}
13621359
1363- static S2N_RESULT s2n_wipe_record (struct s2n_connection * conn )
1364- {
1365- RESULT_ENSURE_REF (conn );
1366- RESULT_GUARD_POSIX (s2n_stuffer_wipe (& conn -> header_in ));
1367- RESULT_GUARD_POSIX (s2n_stuffer_wipe (& conn -> in ));
1368- conn -> in_status = ENCRYPTED ;
1369- return S2N_RESULT_OK ;
1370- }
1371-
13721360static S2N_RESULT s2n_finish_read (struct s2n_connection * conn )
13731361{
13741362 RESULT_ENSURE_REF (conn );
@@ -1439,7 +1427,7 @@ static int s2n_handshake_read_io(struct s2n_connection *conn)
14391427 if ((r < S2N_SUCCESS ) && (s2n_errno == S2N_ERR_EARLY_DATA_TRIAL_DECRYPT )) {
14401428 POSIX_GUARD (s2n_stuffer_reread (& conn -> in ));
14411429 POSIX_GUARD_RESULT (s2n_early_data_record_bytes (conn , s2n_stuffer_data_available (& conn -> in )));
1442- POSIX_GUARD_RESULT (s2n_wipe_record (conn ));
1430+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
14431431 return S2N_SUCCESS ;
14441432 }
14451433 POSIX_GUARD (r );
@@ -1473,7 +1461,7 @@ static int s2n_handshake_read_io(struct s2n_connection *conn)
14731461 POSIX_GUARD (s2n_stuffer_wipe (& conn -> handshake .io ));
14741462
14751463 /* We're done with the record, wipe it */
1476- POSIX_GUARD_RESULT (s2n_wipe_record (conn ));
1464+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
14771465
14781466 /* Advance the state machine if this was an expected message */
14791467 if (EXPECTED_RECORD_TYPE (conn ) == TLS_CHANGE_CIPHER_SPEC && !CONNECTION_IS_WRITER (conn )) {
@@ -1489,7 +1477,7 @@ static int s2n_handshake_read_io(struct s2n_connection *conn)
14891477 /* Ignore record types that we don't support */
14901478
14911479 /* We're done with the record, wipe it */
1492- POSIX_GUARD_RESULT (s2n_wipe_record (conn ));
1480+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
14931481 return S2N_SUCCESS ;
14941482 }
14951483
@@ -1507,7 +1495,7 @@ static int s2n_handshake_read_io(struct s2n_connection *conn)
15071495 /* Break out of this inner loop, but since we're not changing the state, the
15081496 * outer loop in s2n_handshake_io() will read another record.
15091497 */
1510- POSIX_GUARD_RESULT (s2n_wipe_record (conn ));
1498+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
15111499 return S2N_SUCCESS ;
15121500 }
15131501
@@ -1556,7 +1544,7 @@ static int s2n_handshake_read_io(struct s2n_connection *conn)
15561544 }
15571545
15581546 /* We're done with the record, wipe it */
1559- POSIX_GUARD_RESULT (s2n_wipe_record (conn ));
1547+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
15601548 return S2N_SUCCESS ;
15611549}
15621550
@@ -1579,9 +1567,7 @@ static int s2n_handle_retry_state(struct s2n_connection *conn)
15791567
15801568 if (!CONNECTION_IS_WRITER (conn )) {
15811569 /* We're done parsing the record, reset everything */
1582- POSIX_GUARD (s2n_stuffer_wipe (& conn -> header_in ));
1583- POSIX_GUARD (s2n_stuffer_wipe (& conn -> in ));
1584- conn -> in_status = ENCRYPTED ;
1570+ POSIX_GUARD_RESULT (s2n_record_wipe (conn ));
15851571 }
15861572
15871573 if (CONNECTION_IS_WRITER (conn )) {
0 commit comments