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.
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 9ab376d..a6f6a78 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -1875,7 +1875,7 @@
{
return( mbedtls_pk_verify_restartable( &parent->pk,
child->sig_md, hash, mbedtls_md_get_size( md_info ),
- child->sig.p, child->sig.len, &rs_ctx->ecdsa ) );
+ child->sig.p, child->sig.len, &rs_ctx->pk ) );
}
#else
(void) rs_ctx;
@@ -2653,7 +2653,7 @@
*/
void mbedtls_x509_crt_restart_init( mbedtls_x509_crt_restart_ctx *ctx )
{
- mbedtls_ecdsa_restart_init( &ctx->ecdsa );
+ mbedtls_pk_restart_init( &ctx->pk );
ctx->parent = NULL;
ctx->fallback_parent = NULL;
@@ -2675,7 +2675,7 @@
if( ctx == NULL )
return;
- mbedtls_ecdsa_restart_free( &ctx->ecdsa );
+ mbedtls_pk_restart_free( &ctx->pk );
mbedtls_x509_crt_restart_init( ctx );
}