From 6e628a4e7b27cd5fbf93b70179194fedd34abea9 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Tue, 25 Apr 2023 13:11:36 +0200 Subject: [PATCH] Add undfined role for ec j-pake Signed-off-by: Przemek Stekiel --- include/mbedtls/ecjpake.h | 3 ++- library/psa_crypto_pake.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/ecjpake.h b/include/mbedtls/ecjpake.h index a63bb32f3..94864faea 100644 --- a/include/mbedtls/ecjpake.h +++ b/include/mbedtls/ecjpake.h @@ -52,7 +52,8 @@ extern "C" { * Roles in the EC J-PAKE exchange */ typedef enum { - MBEDTLS_ECJPAKE_CLIENT = 0, /**< Client */ + MBEDTLS_ECJPAKE_NONE = 0, /**< Undefined */ + MBEDTLS_ECJPAKE_CLIENT, /**< Client */ MBEDTLS_ECJPAKE_SERVER, /**< Server */ } mbedtls_ecjpake_role; diff --git a/library/psa_crypto_pake.c b/library/psa_crypto_pake.c index 97aafb457..d9b2ecd9a 100644 --- a/library/psa_crypto_pake.c +++ b/library/psa_crypto_pake.c @@ -594,7 +594,7 @@ psa_status_t mbedtls_psa_pake_abort(mbedtls_psa_pake_operation_t *operation) #if defined(MBEDTLS_PSA_BUILTIN_ALG_JPAKE) if (operation->alg == PSA_ALG_JPAKE) { - operation->role = 0; + operation->role = MBEDTLS_ECJPAKE_NONE; mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer)); operation->buffer_length = 0; operation->buffer_offset = 0;