Commit graph

18 commits

Author SHA1 Message Date
Hanno Becker 531fe3054c Comment on hardcoding of maximum HKDF key expansion of 255 Bytes
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-16 09:50:17 +01:00
Hanno Becker 61baae7c9f Minor fixes and improvements in TLS 1.3 key schedule documentation
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-16 09:47:47 +01:00
Hanno Becker 5cfc7245c8 Remove outdated documentation of mbedtls_ssl_tls1_3_derive_secret()
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 13:00:29 +01:00
Hanno Becker 0c42fd94bb Fix Doxygen documentation of mbedtls_ssl_tls1_3_derive_secret()
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 12:58:29 +01:00
Hanno Becker 0973ff9545 Remove macro definitions between Doxygen block and prototype
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 12:56:28 +01:00
Hanno Becker 1413bd8ae9 Simplify identification of TLS 1.3 labels in unit test suite
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 12:46:09 +01:00
Hanno Becker 2fe043a6d1 Remove guard for TLS 1.3 specific declarations
We only guard the implementations of modules, not their declarations.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 10:58:53 +01:00
Hanno Becker 9b9be00606 Remove DTLS 1.3 specific label
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 10:58:52 +01:00
Hanno Becker 00cfc1ce52 Add "e exp master" TLS 1.3 key schedule label
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 10:41:23 +01:00
Hanno Becker 70d7fb0c2d Don't hardcode TLS 1.3 labels in test cases
ssl_tls1_3_keys.c exports a structure containing all labels used
in the TLS 1.3 key schedule, but the TLS 1.3 key scheduling unit
tests so far replicated those labels in the test file. In particular,
wrong label values in ssl_tls1_3_keys.c wouldn't have been caught
by the unit tests.

This commit modifies the TLS 1.3 key schedule unit tests to use
the TLS 1.3 labels as exported by ssl_tls1_3_keys.c. This not only
makes sure that those labels are correct, but also avoids hardcoding
their hex-encoding in the test file.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 10:17:37 +01:00
Hanno Becker 90551c7a26 Use uniform naming scheme for TLS 1.3 label structure
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-09 09:25:23 +01:00
Hanno Becker a3a5a4e1f9 Please check-names.sh
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 11:33:48 +01:00
Hanno Becker 493ea7f4ae Remove instances of camelCase in TLS 1.3 key schedule
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 11:08:06 +01:00
Hanno Becker e4435ea777 Introduce TLS 1.3 labels in a single place
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 10:43:52 +01:00
Hanno Becker e9cccb440c Implement TLS 1.3 key evolution function
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 10:28:28 +01:00
Hanno Becker b35d52240b Implement TLS 1.3 key derivation function Derive-Secret
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 10:28:28 +01:00
Hanno Becker 3385a4d5cf Implement TLS 1.3 traffic key generation
See the documentation in library/ssl_tls13_keys.h.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 10:28:28 +01:00
Hanno Becker be9d6648f8 Implement TLS 1.3 key derivation function HKDF-Expand-Label
This commit introduces a new file library/ssl_tls13_key.c
which will subsequently be populated with functionality relating
to the TLS 1.3 key schedule.

Those functions are expected to be internal and are documented
in the internal header library/ssl_tls13_keys.h.

The first function to be implemented is the key expansion
function `HKDF-Expand-Label`. See the documentation in
library/ssl_tls13_keys.h for more information.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2020-09-08 10:28:06 +01:00