Keep PK layer context in the PK layer

Previously we kept the ecdsa context created by the PK layer for ECDSA
operations on ECKEY in the ecdsa_restart_ctx structure, which was wrong, and
caused by the fact that we didn't have a proper handling of restart
sub-contexts in the PK layer.
This commit is contained in:
Manuel Pégourié-Gonnard 2017-08-18 17:04:07 +02:00
parent 0bbc66cc76
commit fe6877034d
3 changed files with 82 additions and 104 deletions

View file

@ -780,9 +780,6 @@ void mbedtls_ecdsa_restart_init( mbedtls_ecdsa_restart_ctx *ctx )
#if defined(MBEDTLS_ECDSA_DETERMINISTIC)
ctx->det = NULL;
#endif
#if defined(MBEDTLS_PK_C)
ctx->ecdsa = NULL;
#endif
}
/*
@ -805,12 +802,6 @@ void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx )
mbedtls_free( ctx->det );
ctx->det = NULL;
#endif
#if defined(MBEDTLS_PK_C)
mbedtls_ecdsa_free( ctx->ecdsa );
mbedtls_free( ctx->ecdsa );
ctx->ecdsa = NULL;
#endif
}
#endif /* MBEDTLS_ECP_RESTARTABLE */