From 6348181da956c97da6658f0e38b307ac0be0497d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 24 Aug 2017 11:16:01 +0200 Subject: [PATCH] Explicit state assignments in ecdsa too --- library/ecdsa.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/ecdsa.c b/library/ecdsa.c index 73389bb94..981846bb4 100644 --- a/library/ecdsa.c +++ b/library/ecdsa.c @@ -307,9 +307,7 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp, #if defined(MBEDTLS_ECP_RESTARTABLE) if( rs_ctx != NULL && rs_ctx->sig != NULL ) - { - rs_ctx->sig->state++; - } + rs_ctx->sig->state = ecdsa_sig_mul; mul: #endif @@ -321,7 +319,7 @@ mul: #if defined(MBEDTLS_ECP_RESTARTABLE) if( rs_ctx != NULL && rs_ctx->sig != NULL ) - rs_ctx->sig->state++; + rs_ctx->sig->state = ecdsa_sig_modn; modn: #endif @@ -426,7 +424,7 @@ static int ecdsa_sign_det_restartable( mbedtls_ecp_group *grp, #if defined(MBEDTLS_ECP_RESTARTABLE) if( rs_ctx != NULL && rs_ctx->det != NULL ) - rs_ctx->det->state++; + rs_ctx->det->state = ecdsa_det_sign; sign: #endif @@ -521,7 +519,7 @@ static int ecdsa_verify_restartable( mbedtls_ecp_group *grp, #if defined(MBEDTLS_ECP_RESTARTABLE) if( rs_ctx != NULL && rs_ctx->ver != NULL ) - rs_ctx->ver->state++; + rs_ctx->ver->state = ecdsa_ver_muladd; muladd: #endif