tinyCrypt: Add ServerKeyExchange parsing code

This commit is contained in:
Hanno Becker 2019-07-23 16:16:15 +01:00
parent d849c7ca19
commit 75f12d1eb9
4 changed files with 70 additions and 1 deletions

View file

@ -4206,7 +4206,9 @@ static int ssl_in_client_key_exchange_parse( mbedtls_ssl_context *ssl,
{
const struct uECC_Curve_t * uecc_curve = uECC_secp256r1();
/* TODO: Parse the client's key share. */
ret = mbedtls_ssl_ecdh_read_peerkey( ssl, &p, end );
if( ret != 0 )
return( ret );
if( !uECC_shared_secret( ssl->handshake->ecdh_peerkey,
ssl->handshake->ecdh_privkey,