Skip to content

Commit

Permalink
Remove some TODO(RECLAYER) comments
Browse files Browse the repository at this point in the history
Some TODO(RECLAYER) comments are no longer necessary and can be removed.

Reviewed-by: Hugo Landau <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#18132)
  • Loading branch information
mattcaswell committed Aug 18, 2022
1 parent 81c9ebd commit 4564b47
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 31 deletions.
1 change: 0 additions & 1 deletion ssl/record/methods/dtls_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions ssl/record/methods/ktls_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions ssl/record/methods/recmethod_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions ssl/record/methods/ssl3_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion ssl/record/methods/tls13_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions ssl/record/methods/tls1_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions ssl/record/methods/tls_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*-
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion ssl/record/methods/tlsany_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions ssl/record/recordmethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ssl/t1_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ssl/tls13_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4564b47

Please sign in to comment.