mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-26 23:14:07 +08:00
Re-introduce ENUM validation in ecjpake.c
Signed-off-by: Tuvshinzaya Erdenekhuu <tuvshinzaya.erdenekhuu@arm.com>
This commit is contained in:
parent
2b1ecdaf4e
commit
a891f83803
@ -34,12 +34,6 @@
|
|||||||
|
|
||||||
#if !defined(MBEDTLS_ECJPAKE_ALT)
|
#if !defined(MBEDTLS_ECJPAKE_ALT)
|
||||||
|
|
||||||
/* Parameter validation macros based on platform_util.h */
|
|
||||||
#define ECJPAKE_VALIDATE_RET( cond ) \
|
|
||||||
MBEDTLS_INTERNAL_VALIDATE_RET( cond, MBEDTLS_ERR_ECP_BAD_INPUT_DATA )
|
|
||||||
#define ECJPAKE_VALIDATE( cond ) \
|
|
||||||
MBEDTLS_INTERNAL_VALIDATE( cond )
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert a mbedtls_ecjpake_role to identifier string
|
* Convert a mbedtls_ecjpake_role to identifier string
|
||||||
*/
|
*/
|
||||||
@ -105,8 +99,8 @@ int mbedtls_ecjpake_setup( mbedtls_ecjpake_context *ctx,
|
|||||||
{
|
{
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
ECJPAKE_VALIDATE_RET( role == MBEDTLS_ECJPAKE_CLIENT ||
|
if( role != MBEDTLS_ECJPAKE_CLIENT && role != MBEDTLS_ECJPAKE_SERVER )
|
||||||
role == MBEDTLS_ECJPAKE_SERVER );
|
return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA );
|
||||||
|
|
||||||
ctx->role = role;
|
ctx->role = role;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user