Remove some TODO(RECLAYER) comments
authorMatt Caswell <matt@openssl.org>
Wed, 20 Jul 2022 13:49:53 +0000 (14:49 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Aug 2022 15:38:13 +0000 (16:38 +0100)
Some TODO(RECLAYER) comments are no longer necessary and can be removed.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

12 files changed:
ssl/record/methods/dtls_meth.c
ssl/record/methods/ktls_meth.c
ssl/record/methods/recmethod_local.h
ssl/record/methods/ssl3_meth.c
ssl/record/methods/tls13_meth.c
ssl/record/methods/tls1_meth.c
ssl/record/methods/tls_common.c
ssl/record/methods/tlsany_meth.c
ssl/record/recordmethod.h
ssl/ssl_lib.c
ssl/t1_enc.c
ssl/tls13_enc.c

index 91101a41a2f8f3c822cfc801c4cd04ada64a27d6..2609724b9e21ff31c7d556a53a7525d469d92fa4 100644 (file)
@@ -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,
index 983fe4a913920d0f6f5948749cc7b77aad94c579..036e46f8e946619f60f45f9f7d31af8edec32a73 100644 (file)
@@ -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,
index d40cd54f9e1d8850d5b2322e2fb178ddf761c7ac..7e119e617418a626526bf37307c5ea7d2c06323a 100644 (file)
@@ -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,
index c8062679a2bbfe84638ac117fa51546bc0cdf53a..21aed435329bb727cb59e709ba4e6b25abe681ed 100644 (file)
 #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)
index 0ef499ce410d095115833894517f906a30ba4274..aea432c63ad5a60fd8e15d7a7bd88df7b59935af 100644 (file)
@@ -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)
index af2a18858c8977e57b30a5e6ea73d3fc4eb14fee..b7b9f6989b23e382c606dd158fff197577b9ff2d 100644 (file)
 #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)
index 7fac42ef2de7d6d67f037f49d784b9ccfbe3616b..9ae91184956b0103f21e58c08cdefb2527b0b0ab 100644 (file)
@@ -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,
index ecc833a7f191c3dfc86b8cb6d22698fd266e8335..8f731af0922d6c8ea4d2a9d70fe4e6f78ee131a0 100644 (file)
@@ -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)
index 8ef06dfc6cf44e419444e1179d2f0c29536b12f0..95732cae2ca55496d670b49b9b83aef00983c742 100644 (file)
@@ -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,
index 754f9f27cff33c41acdd227999b9a9f5ec0e79ba..9471c3f09b489ee8201a062bd3e0a59d3d400d2d 100644 (file)
@@ -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,
index b1f91ed60e2824e0983a48eb0bbc110b1e86baa8..2667765be35811c0ee981a4cebd6b8597c96c8fe 100644 (file)
@@ -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;
index 7e609a4ba2f69698ca712bbe50a2850fd1c922c8..437deaa9930ecf159a98e0c8c868e11436b8bfb7 100644 (file)
@@ -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;
     }