summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-07-27 14:28:36 +0100
committerMatt Caswell <matt@openssl.org>2022-08-18 16:38:14 +0100
commit9007412c1e1fd4bb9298901dae36064cd279c02a (patch)
treead115f7d3ca4197c16b5ac643f18f345a0b18ee6 /ssl
parent4a532de98d6100d9e0643d5b61d8716539c8a7cd (diff)
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)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/methods/dtls_meth.c13
-rw-r--r--ssl/record/methods/tls_common.c5
-rw-r--r--ssl/record/record.h3
3 files changed, 1 insertions, 20 deletions
diff --git a/ssl/record/methods/dtls_meth.c b/ssl/record/methods/dtls_meth.c
index 718e0d8e5e..05bfa6e2d7 100644
--- a/ssl/record/methods/dtls_meth.c
+++ b/ssl/record/methods/dtls_meth.c
@@ -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 */
}
diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c
index 4fc5c010de..13efb82c61 100644
--- a/ssl/record/methods/tls_common.c
+++ b/ssl/record/methods/tls_common.c
@@ -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;
diff --git a/ssl/record/record.h b/ssl/record/record.h
index 4d3f7169dd..d3984195af 100644
--- a/ssl/record/record.h
+++ b/ssl/record/record.h
@@ -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;