Skip to content

Commit

Permalink
Remove some references to rlayer.rstate
Browse files Browse the repository at this point in the history
This also fixes ssl3_pending while we are at it

Reviewed-by: Hugo Landau <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#18132)
  • Loading branch information
mattcaswell committed Aug 18, 2022
1 parent db1a505 commit 8bbf7ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 9 additions & 1 deletion ssl/record/methods/tls_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,15 @@ int tls_processed_read_pending(OSSL_RECORD_LAYER *rl)

size_t tls_app_data_pending(OSSL_RECORD_LAYER *rl)
{
return 0;
size_t i;
size_t num = 0;

for (i = rl->curr_rec; i <rl->num_recs; i++) {
if (rl->rrec[i].type != SSL3_RT_APPLICATION_DATA)
return num;
num += rl->rrec[i].length;
}
return num;
}

int tls_write_pending(OSSL_RECORD_LAYER *rl)
Expand Down
5 changes: 1 addition & 4 deletions ssl/record/rec_layer_d1.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,8 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf,
OPENSSL_cleanse(&(rr->data[rr->off]), n);
rr->length -= n;
rr->off += n;
if (rr->length == 0) {
/* TODO(RECLAYER): Do something with this? */
sc->rlayer.rstate = SSL_ST_READ_HEADER;
if (rr->length == 0)
ssl_release_record(sc, rr);
}
}
#ifndef OPENSSL_NO_SCTP
/*
Expand Down
7 changes: 1 addition & 6 deletions ssl/record/rec_layer_s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,13 +1357,8 @@ int ssl3_read_bytes(SSL *ssl, int type, int *recvd_type, unsigned char *buf,
OPENSSL_cleanse(&(rr->data[rr->off]), n);
rr->length -= n;
rr->off += n;
if (rr->length == 0) {
/* TODO(RECLAYER): What to do with this? Is it needed? */
#if 0
s->rlayer.rstate = SSL_ST_READ_HEADER;
#endif
if (rr->length == 0)
ssl_release_record(s, rr);
}
}
if (rr->length == 0
|| (peek && n == rr->length)) {
Expand Down

0 comments on commit 8bbf7ef

Please sign in to comment.