Optimize code (pake role type, freeing buffers)
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
6e628a4e7b
commit
aede2ad554
2 changed files with 5 additions and 5 deletions
|
@ -52,9 +52,9 @@ extern "C" {
|
|||
* Roles in the EC J-PAKE exchange
|
||||
*/
|
||||
typedef enum {
|
||||
MBEDTLS_ECJPAKE_NONE = 0, /**< Undefined */
|
||||
MBEDTLS_ECJPAKE_CLIENT, /**< Client */
|
||||
MBEDTLS_ECJPAKE_CLIENT = 0, /**< Client */
|
||||
MBEDTLS_ECJPAKE_SERVER, /**< Server */
|
||||
MBEDTLS_ECJPAKE_NONE, /**< Undefined */
|
||||
} mbedtls_ecjpake_role;
|
||||
|
||||
#if !defined(MBEDTLS_ECJPAKE_ALT)
|
||||
|
|
|
@ -289,9 +289,6 @@ psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
|
|||
goto error;
|
||||
}
|
||||
|
||||
/* Role has been set, release user/peer buffers. */
|
||||
mbedtls_free(user); mbedtls_free(peer);
|
||||
|
||||
operation->buffer_length = 0;
|
||||
operation->buffer_offset = 0;
|
||||
|
||||
|
@ -300,6 +297,9 @@ psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
|
|||
goto error;
|
||||
}
|
||||
|
||||
/* Role has been set, release user/peer buffers. */
|
||||
mbedtls_free(user); mbedtls_free(peer);
|
||||
|
||||
return PSA_SUCCESS;
|
||||
} else
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue