From: Matt Caswell Date: Wed, 20 Jul 2022 13:49:53 +0000 (+0100) Subject: Remove some TODO(RECLAYER) comments X-Git-Tag: openssl-3.2.0-alpha1~2220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4564b47d7546a2225e1565715030981387b8e393;p=thirdparty%2Fopenssl.git Remove some TODO(RECLAYER) comments Some TODO(RECLAYER) comments are no longer necessary and can be removed. Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18132) --- diff --git a/ssl/record/methods/dtls_meth.c b/ssl/record/methods/dtls_meth.c index 91101a41a2f..2609724b9e2 100644 --- a/ssl/record/methods/dtls_meth.c +++ b/ssl/record/methods/dtls_meth.c @@ -645,7 +645,6 @@ dtls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, unsigned char *key, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp, BIO *prev, BIO *transport, BIO *next, BIO_ADDR *local, BIO_ADDR *peer, diff --git a/ssl/record/methods/ktls_meth.c b/ssl/record/methods/ktls_meth.c index 983fe4a9139..036e46f8e94 100644 --- a/ssl/record/methods/ktls_meth.c +++ b/ssl/record/methods/ktls_meth.c @@ -21,7 +21,7 @@ /* * TODO(RECLAYER): This is essentially a copy of ktls_int_check_supported_cipher * but using an SSL object instead of an OSSL_RECORD_LAYER object. Once - * everything has been moved to the reocrd layer this can be deleted + * the write side has been moved to the record layer this can be deleted */ int ktls_check_supported_cipher(const SSL_CONNECTION *s, const EVP_CIPHER *c, const EVP_MD *md, size_t taglen) @@ -163,7 +163,7 @@ int ktls_configure_crypto(OSSL_LIB_CTX *libctx, int version, const EVP_CIPHER *c /* * TODO(RECLAYER): This is essentially a copy of ktls_int_check_supported_cipher * but using an SSL object instead of an OSSL_RECORD_LAYER object. Once - * everything has been moved to the reocrd layer this can be deleted + * the write side has been moved to the record layer this can be deleted */ int ktls_check_supported_cipher(const SSL_CONNECTION *s, const EVP_CIPHER *c, const EVP_MD *md, size_t taglen) @@ -355,14 +355,12 @@ int ktls_configure_crypto(OSSL_LIB_CTX *libctx, int version, const EVP_CIPHER *c #endif /* OPENSSL_SYS_LINUX */ -/* TODO(RECLAYER): Handle OPENSSL_NO_COMP */ static int ktls_set_crypto_state(OSSL_RECORD_LAYER *rl, int level, unsigned char *key, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp) @@ -487,7 +485,6 @@ ktls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, unsigned char *key, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp, BIO *prev, BIO *transport, BIO *next, BIO_ADDR *local, BIO_ADDR *peer, diff --git a/ssl/record/methods/recmethod_local.h b/ssl/record/methods/recmethod_local.h index d40cd54f9e1..7e119e61741 100644 --- a/ssl/record/methods/recmethod_local.h +++ b/ssl/record/methods/recmethod_local.h @@ -27,7 +27,6 @@ struct record_functions_st unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp); @@ -261,7 +260,6 @@ tls_int_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp, BIO *prev, BIO *transport, BIO *next, diff --git a/ssl/record/methods/ssl3_meth.c b/ssl/record/methods/ssl3_meth.c index c8062679a2b..21aed435329 100644 --- a/ssl/record/methods/ssl3_meth.c +++ b/ssl/record/methods/ssl3_meth.c @@ -13,14 +13,12 @@ #include "../record_local.h" #include "recmethod_local.h" -/* TODO(RECLAYER): Handle OPENSSL_NO_COMP */ static int ssl3_set_crypto_state(OSSL_RECORD_LAYER *rl, int level, unsigned char *key, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp) diff --git a/ssl/record/methods/tls13_meth.c b/ssl/record/methods/tls13_meth.c index 0ef499ce410..aea432c63ad 100644 --- a/ssl/record/methods/tls13_meth.c +++ b/ssl/record/methods/tls13_meth.c @@ -19,7 +19,6 @@ static int tls13_set_crypto_state(OSSL_RECORD_LAYER *rl, int level, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp) diff --git a/ssl/record/methods/tls1_meth.c b/ssl/record/methods/tls1_meth.c index af2a18858c8..b7b9f6989b2 100644 --- a/ssl/record/methods/tls1_meth.c +++ b/ssl/record/methods/tls1_meth.c @@ -14,14 +14,12 @@ #include "../record_local.h" #include "recmethod_local.h" -/* TODO(RECLAYER): Handle OPENSSL_NO_COMP */ static int tls1_set_crypto_state(OSSL_RECORD_LAYER *rl, int level, unsigned char *key, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp) diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c index 7fac42ef2de..9ae91184956 100644 --- a/ssl/record/methods/tls_common.c +++ b/ssl/record/methods/tls_common.c @@ -698,10 +698,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl) } } - /* - * TODO(RECLAYER): Only call rl functions once TLSv1.3/SSLv3 is moved to new - * record layer code - */ enc_err = rl->funcs->cipher(rl, rr, num_recs, 0, macbufs, mac_size); /*- @@ -1015,7 +1011,6 @@ tls_int_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp, BIO *prev, BIO *transport, BIO *next, BIO_ADDR *local, @@ -1161,7 +1156,6 @@ tls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, unsigned char *key, size_t keylen, unsigned char *iv, size_t ivlen, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp, BIO *prev, BIO *transport, BIO *next, BIO_ADDR *local, BIO_ADDR *peer, diff --git a/ssl/record/methods/tlsany_meth.c b/ssl/record/methods/tlsany_meth.c index ecc833a7f19..8f731af0922 100644 --- a/ssl/record/methods/tlsany_meth.c +++ b/ssl/record/methods/tlsany_meth.c @@ -18,7 +18,6 @@ static int tls_any_set_crypto_state(OSSL_RECORD_LAYER *rl, int level, unsigned char *mackey, size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp) diff --git a/ssl/record/recordmethod.h b/ssl/record/recordmethod.h index 8ef06dfc6cf..95732cae2ca 100644 --- a/ssl/record/recordmethod.h +++ b/ssl/record/recordmethod.h @@ -139,9 +139,9 @@ struct ossl_record_method_st { */ /* - * TODO(RECLAYER): Will have to be something other than EVP_CIPHER if we - * make this fetchable - * TODO(RECLAYER): mactype should not be an int + * If we eventually make this fetchable then we will need to use something + * other than EVP_CIPHER. Also mactype would not be a NID, but a string. For + * now though, this works. */ int (*new_record_layer)(OSSL_LIB_CTX *libctx, const char *propq, int vers, @@ -156,7 +156,6 @@ struct ossl_record_method_st { size_t mackeylen, const EVP_CIPHER *ciph, size_t taglen, - /* TODO(RECLAYER): This probably should not be an int */ int mactype, const EVP_MD *md, const SSL_COMP *comp, diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 754f9f27cff..9471c3f09b4 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -659,11 +659,6 @@ int ossl_ssl_connection_reset(SSL *s) BIO_free(sc->rrlnext); sc->rrlnext = NULL; - /* - * TODO(RECLAYER): The record method should probably initialy come from the - * SSL_METHOD, and potentially be updated later. For now though we just - * assign it. - */ if (!ssl_set_new_record_layer(sc, SSL_CONNECTION_IS_DTLS(sc) ? DTLS_ANY_VERSION : TLS_ANY_VERSION, OSSL_RECORD_DIRECTION_READ, diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index b1f91ed60e2..2667765be35 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -252,7 +252,7 @@ int tls1_change_cipher_state(SSL_CONNECTION *s, int which) goto err; } - /* TODO(RECLAYER): Temporary - remove me */ + /* TODO(RECLAYER): Temporary - remove me when write rlayer done*/ goto skip_ktls; } else { s->statem.enc_write_state = ENC_WRITE_STATE_INVALID; diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c index 7e609a4ba2f..437deaa9930 100644 --- a/ssl/tls13_enc.c +++ b/ssl/tls13_enc.c @@ -724,7 +724,7 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which) /* SSLfatal already called */ goto err; } - /* TODO(RECLAYER): Remove me */ + /* TODO(RECLAYER): Remove me when write rlayer done */ goto skip_ktls; }