Remove the SSL3_RECORD read field

The read field is no longer used and can be safely removed.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)
This commit is contained in:
Matt Caswell 2022-07-27 14:28:36 +01:00
parent 4a532de98d
commit 9007412c1e
3 changed files with 1 additions and 20 deletions

View File

@ -449,7 +449,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
p += 6;
n2s(p, rr->length);
rr->read = 0;
/*
* Lets check the version. We tolerate alerts that don't have the exact
@ -459,7 +458,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
if (version != rl->version) {
/* unexpected version, silently discard */
rr->length = 0;
rr->read = 1;
rl->packet_length = 0;
goto again;
}
@ -471,7 +469,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
: rl->version >> 8)) {
/* wrong version, silently discard record */
rr->length = 0;
rr->read = 1;
rl->packet_length = 0;
goto again;
}
@ -479,7 +476,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH) {
/* record too long, silently discard it */
rr->length = 0;
rr->read = 1;
rl->packet_length = 0;
goto again;
}
@ -493,7 +489,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
&& rr->length > rl->max_frag_len + SSL3_RT_MAX_ENCRYPTED_OVERHEAD) {
/* record too long, silently discard it */
rr->length = 0;
rr->read = 1;
rl->packet_length = 0;
goto again;
}
@ -515,7 +510,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
return OSSL_RECORD_RETURN_FATAL;
}
rr->length = 0;
rr->read = 1;
rl->packet_length = 0;
goto again;
}
@ -542,7 +536,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
/* Check whether this is a repeat, or aged record. */
if (!dtls_record_replay_check(rl, bitmap)) {
rr->length = 0;
rr->read = 1;
rl->packet_length = 0; /* dump this record */
goto again; /* get another record */
}
@ -551,10 +544,8 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
#endif
/* just read a 0 length packet */
if (rr->length == 0) {
rr->read = 1;
if (rr->length == 0)
goto again;
}
/*
* If this record is from the next epoch (either HM or ALERT), and a
@ -571,7 +562,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
}
}
rr->length = 0;
rr->read = 1;
rl->packet_length = 0;
goto again;
}
@ -582,7 +572,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
return OSSL_RECORD_RETURN_FATAL;
}
rr->length = 0;
rr->read = 1;
rl->packet_length = 0; /* dump this record */
goto again; /* get another record */
}

View File

@ -588,9 +588,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
thisrr->data = thisrr->input;
thisrr->orig_len = thisrr->length;
/* Mark this record as not read by upper layers yet */
thisrr->read = 0;
num_recs++;
/* we have pulled in a full packet so zero things */
@ -627,7 +624,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
SSL_R_UNEXPECTED_CCS_MESSAGE);
return OSSL_RECORD_RETURN_FATAL;
}
thisrr->read = 1;
rl->num_recs = 0;
rl->curr_rec = 0;
rl->num_released = 0;
@ -714,7 +710,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
}
thisrr->length = 0;
thisrr->read = 1;
rl->num_recs = 0;
rl->curr_rec = 0;
rl->num_released = 0;

View File

@ -65,9 +65,6 @@ typedef struct ssl3_record_st {
/* only used with decompression - malloc()ed */
/* r */
unsigned char *comp;
/* Whether the data from this record has already been read or not */
/* r */
unsigned int read;
/* epoch number, needed by DTLS1 */
/* r */
unsigned long epoch;