From 99733f05111f1fd59655e5c0d0933353d37c3c4e Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 27 Sep 2021 13:58:21 +0200 Subject: [PATCH] Amend vector variables Signed-off-by: Ronald Cron --- docs/architecture/tls13-experimental.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/architecture/tls13-experimental.md b/docs/architecture/tls13-experimental.md index defba776a..ca97a251c 100644 --- a/docs/architecture/tls13-experimental.md +++ b/docs/architecture/tls13-experimental.md @@ -242,25 +242,24 @@ TLS 1.3 specific coding rules: length in bytes of the vector, where is the name of the vector as defined in the TLS 1.3 specification. - - Use `_len_ptr` for the name of a variable intended to hold + - Use `p__len` for the name of a variable intended to hold the address of the first byte of the vector length. - - Use `_ptr` for the name of a variable intended to hold the + - Use `` for the name of a variable intended to hold the address of the first byte of the vector value. - - Use `_end_ptr` for the name of a variable intended to hold + - Use `_end` for the name of a variable intended to hold the address of the first byte past the vector value. - Those two last idioms should lower the risk of mis-using one of the address - in place of the other one which could potentially lead to some nasty - issues. + Those idioms should lower the risk of mis-using one of the address in place + of another one which could potentially lead to some nasty issues. Example: `cipher_suites` vector of ClientHello in `ssl_tls1_3_write_client_hello_cipher_suites()` ``` size_t cipher_suites_len; - unsigned char *cipher_suites_len_ptr; - unsigned char *cipher_suites_ptr; + unsigned char *p_cipher_suites_len; + unsigned char *cipher_suites; ``` - Use of MBEDTLS_BYTE_xyz, MBEDTLS_PUT/GET_xyz, MBEDTLS_SSL_CHK_BUF_PTR