summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-07-27 14:50:16 +0100
committerMatt Caswell <matt@openssl.org>2022-08-18 16:38:14 +0100
commit9b7fb65e1520f398344ea8b7f3b4b097ae2617d7 (patch)
tree054d013f4e767ca5c9af4bb84de3b7cfe1e765ea /ssl
parentf6aab7b1e1410cf28ec45410aa4ee54f40baf13d (diff)
Rename some functions to be more consistent
Some functions in the record layer were called rlayer_*, but most were called tls_*. We standardise on the latter. 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.c7
-rw-r--r--ssl/record/methods/recmethod_local.h2
-rw-r--r--ssl/record/methods/tls_common.c14
3 files changed, 11 insertions, 12 deletions
diff --git a/ssl/record/methods/dtls_meth.c b/ssl/record/methods/dtls_meth.c
index d5dae75c4f..eebea6289d 100644
--- a/ssl/record/methods/dtls_meth.c
+++ b/ssl/record/methods/dtls_meth.c
@@ -313,9 +313,8 @@ static int dtls_rlayer_buffer_record(OSSL_RECORD_LAYER *rl, record_pqueue *queue
memset(&rl->rbuf, 0, sizeof(SSL3_BUFFER));
memset(&rl->rrec[0], 0, sizeof(rl->rrec[0]));
-
- if (!rlayer_setup_read_buffer(rl)) {
- /* SSLfatal() already called */
+ if (!tls_setup_read_buffer(rl)) {
+ /* RLAYERfatal() already called */
OPENSSL_free(rdata->rbuf.buf);
OPENSSL_free(rdata);
pitem_free(item);
@@ -397,7 +396,7 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
rr = rl->rrec;
if (rl->rbuf.buf == NULL) {
- if (!rlayer_setup_read_buffer(rl)) {
+ if (!tls_setup_read_buffer(rl)) {
/* RLAYERfatal() already called */
return OSSL_RECORD_RETURN_FATAL;
}
diff --git a/ssl/record/methods/recmethod_local.h b/ssl/record/methods/recmethod_local.h
index d85e377b68..95ba642b91 100644
--- a/ssl/record/methods/recmethod_local.h
+++ b/ssl/record/methods/recmethod_local.h
@@ -293,4 +293,4 @@ void tls_set_max_pipelines(OSSL_RECORD_LAYER *rl, size_t max_pipelines);
void tls_get_state(OSSL_RECORD_LAYER *rl, const char **shortstr,
const char **longstr);
int tls_set_options(OSSL_RECORD_LAYER *rl, const OSSL_PARAM *options);
-int rlayer_setup_read_buffer(OSSL_RECORD_LAYER *rl);
+int tls_setup_read_buffer(OSSL_RECORD_LAYER *rl);
diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c
index 00454b43c8..d98badffe4 100644
--- a/ssl/record/methods/tls_common.c
+++ b/ssl/record/methods/tls_common.c
@@ -86,7 +86,7 @@ char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx)
}
#ifndef OPENSSL_NO_COMP
-static int rlayer_allow_compression(OSSL_RECORD_LAYER *rl)
+static int tls_allow_compression(OSSL_RECORD_LAYER *rl)
{
if (rl->options & SSL_OP_NO_COMPRESSION)
return 0;
@@ -95,7 +95,7 @@ static int rlayer_allow_compression(OSSL_RECORD_LAYER *rl)
}
#endif
-int rlayer_setup_read_buffer(OSSL_RECORD_LAYER *rl)
+int tls_setup_read_buffer(OSSL_RECORD_LAYER *rl)
{
unsigned char *p;
size_t len, align = 0, headerlen;
@@ -116,7 +116,7 @@ int rlayer_setup_read_buffer(OSSL_RECORD_LAYER *rl)
len = SSL3_RT_MAX_PLAIN_LENGTH
+ SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align;
#ifndef OPENSSL_NO_COMP
- if (rlayer_allow_compression(rl))
+ if (tls_allow_compression(rl))
len += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
#endif
if (b->default_len > len)
@@ -137,7 +137,7 @@ int rlayer_setup_read_buffer(OSSL_RECORD_LAYER *rl)
return 1;
}
-static int rlayer_release_read_buffer(OSSL_RECORD_LAYER *rl)
+static int tls_release_read_buffer(OSSL_RECORD_LAYER *rl)
{
SSL3_BUFFER *b;
@@ -300,7 +300,7 @@ int tls_default_read_n(OSSL_RECORD_LAYER *rl, size_t n, size_t max, int extend,
rb->left = left;
if ((rl->mode & SSL_MODE_RELEASE_BUFFERS) != 0 && !rl->isdtls)
if (len + left == 0)
- rlayer_release_read_buffer(rl);
+ tls_release_read_buffer(rl);
return ret;
}
left += bioread;
@@ -428,7 +428,7 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
rr = rl->rrec;
rbuf = &rl->rbuf;
if (rbuf->buf == NULL) {
- if (!rlayer_setup_read_buffer(rl)) {
+ if (!tls_setup_read_buffer(rl)) {
/* RLAYERfatal() already called */
return OSSL_RECORD_RETURN_FATAL;
}
@@ -988,7 +988,7 @@ int tls_release_record(OSSL_RECORD_LAYER *rl, void *rechandle)
if (rl->curr_rec == rl->num_released
&& (rl->mode & SSL_MODE_RELEASE_BUFFERS) != 0
&& SSL3_BUFFER_get_left(&rl->rbuf) == 0)
- rlayer_release_read_buffer(rl);
+ tls_release_read_buffer(rl);
return OSSL_RECORD_RETURN_SUCCESS;
}