This also fixes ssl3_pending while we are at it
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)
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)
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
/*
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)) {