Skip to content

Commit 599aff0

Browse files
Andrzej KurekSebastianBoe
authored andcommitted
[nrf fromtree] Clarify the need for calling mbedtls_ssl_derive_keys after extension 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> Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no> (cherry picked from commit 21b5080)
1 parent 445e80e commit 599aff0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

library/ssl_cli.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,12 @@ static int ssl_parse_server_hello( mbedtls_ssl_context *ssl )
23682368
}
23692369
}
23702370

2371-
if( ssl->state == MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC )
2371+
/*
2372+
* mbedtls_ssl_derive_keys() has to be called after the parsing of the
2373+
* extensions. It sets the transform data for the resumed session which in
2374+
* case of DTLS includes the server CID extracted from the CID extension.
2375+
*/
2376+
if( ssl->handshake->resume )
23722377
{
23732378
if( ( ret = mbedtls_ssl_derive_keys( ssl ) ) != 0 )
23742379
{

0 commit comments

Comments
 (0)