From: Matt Caswell Date: Fri, 9 Sep 2022 14:34:52 +0000 (+0100) Subject: Resove some outstanding TODOs X-Git-Tag: openssl-3.2.0-alpha1~2023 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6d5f343336532a7aba4368099b0631a457194a6;p=thirdparty%2Fopenssl.git Resove some outstanding TODOs Reviewed-by: Hugo Landau Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/19198) --- diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index d3c83701a51..792b0716d8c 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -188,10 +188,6 @@ int ssl3_write_bytes(SSL *ssl, int type, const void *buf_, size_t len, const unsigned char *buf = buf_; size_t tot; size_t n, max_send_fragment, split_send_fragment, maxpipes; - /* TODO(RECLAYER): Re-enable multiblock code */ -#if 0 && !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK - size_t nw; -#endif int i; SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL_ONLY(ssl); OSSL_RECORD_TEMPLATE tmpls[SSL_MAX_PIPELINES]; @@ -276,7 +272,6 @@ int ssl3_write_bytes(SSL *ssl, int type, const void *buf_, size_t len, s->rlayer.wpend_ret = len; } - /* TODO(RECLAYER): Is this needed any more? */ if (tot == len) { /* done? */ *written = tot; return 1; @@ -296,19 +291,20 @@ int ssl3_write_bytes(SSL *ssl, int type, const void *buf_, size_t len, max_send_fragment = ssl_get_max_send_fragment(s); split_send_fragment = ssl_get_split_send_fragment(s); + /* - * TODO(RECLAYER): This comment is now out-of-date and probably needs to - * move somewhere else - * - * If max_pipelines is 0 then this means "undefined" and we default to - * 1 pipeline. Similarly if the cipher does not support pipelined - * processing then we also only use 1 pipeline, or if we're not using - * explicit IVs + * Ask the record layer how it would like to split the amount of data that + * we have, and how many of those records it would like in one go. */ - maxpipes = s->rlayer.wrlmethod->get_max_records(s->rlayer.wrl, type, n, max_send_fragment, &split_send_fragment); + /* + * If max_pipelines is 0 then this means "undefined" and we default to + * whatever the record layer wants to do. Otherwise we use the smallest + * value from the number requested by the record layer, and max number + * configured by the user. + */ if (s->max_pipelines > 0 && maxpipes > s->max_pipelines) maxpipes = s->max_pipelines;