Introduce mbedtls_pk_restart_ctx and use it

The fact that you needed to pass a pointer to mbedtls_ecdsa_restart_ctx (or
that you needed to know the key type of the PK context) was a breach of
abstraction.

Change the API (and callers) now, and the implementation will be changed in
the next commit.
This commit is contained in:
Manuel Pégourié-Gonnard 2017-08-17 14:33:31 +02:00
parent 98a6778d47
commit 15d7df2ba8
6 changed files with 69 additions and 25 deletions

View file

@ -2615,7 +2615,7 @@ ske_process:
#if defined(MBEDTLS_SSL__ECP_RESTARTABLE)
if( ssl->handshake->ecrs_enabled )
rs_ctx = &ssl->handshake->ecrs_ctx.ecdsa;
rs_ctx = &ssl->handshake->ecrs_ctx.pk;
#endif
if( ( ret = mbedtls_pk_verify_restartable(
@ -3290,7 +3290,7 @@ keys_derived:
#if defined(MBEDTLS_SSL__ECP_RESTARTABLE)
if( ssl->handshake->ecrs_enabled )
rs_ctx = &ssl->handshake->ecrs_ctx.ecdsa;
rs_ctx = &ssl->handshake->ecrs_ctx.pk;
#endif
if( ( ret = mbedtls_pk_sign_restartable( mbedtls_ssl_own_key( ssl ),