Set CID pointer to default value even for TLS

There are two options:
1. Don't set it, and don't use it during record protection,
   guarding the respective paths by a check whether TLS or
   DTLS is used.
2. Set it to the default value even for TLS, and avoid the
   protocol-dependent branch during record protection.

This commit picks option 2.
This commit is contained in:
Hanno Becker 2019-05-08 16:43:21 +01:00
parent 4a4af9fcbe
commit 4c3eb7c919

View file

@ -8082,6 +8082,9 @@ static void ssl_update_out_pointers( mbedtls_ssl_context *ssl,
{
ssl->out_ctr = ssl->out_hdr - 8;
ssl->out_len = ssl->out_hdr + 3;
#if defined(MBEDTLS_SSL_CID)
ssl->out_cid = ssl->out_len;
#endif
ssl->out_iv = ssl->out_hdr + 5;
}
@ -8136,6 +8139,9 @@ static void ssl_update_in_pointers( mbedtls_ssl_context *ssl )
{
ssl->in_ctr = ssl->in_hdr - 8;
ssl->in_len = ssl->in_hdr + 3;
#if defined(MBEDTLS_SSL_CID)
ssl->in_cid = ssl->in_len;
#endif
ssl->in_iv = ssl->in_hdr + 5;
}