Skip to content

Commit

Permalink
Clarify the need for calling mbedtls_ssl_derive_keys after extension …
Browse files Browse the repository at this point in the history
…parsing

Use a more straightforward condition to note that session resumption
is happening.
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
  • Loading branch information
Andrzej Kurek committed Jul 6, 2022
1 parent 33b731f commit 77473eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/ssl_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2527,7 +2527,12 @@ static int ssl_parse_server_hello( mbedtls_ssl_context *ssl )
}
}

if( ssl->state == MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC )
/*
* mbedtls_ssl_derive_keys() has to be called after the parsing of the
* extensions. It sets the transform data for the resumed session which in
* case of DTLS includes the server CID extracted from the CID extension.
*/
if( ssl->handshake->resume )
{
if( ( ret = mbedtls_ssl_derive_keys( ssl ) ) != 0 )
{
Expand Down

0 comments on commit 77473eb

Please sign in to comment.