From 7921a03425eb50317949807184690b4cda2a4320 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Fri, 14 Apr 2023 14:29:57 +0200 Subject: [PATCH] Add claryfication for PSA_PAKE_INPUT/OUTPUT_MAX_SIZE macros Signed-off-by: Przemek Stekiel --- include/psa/crypto_extra.h | 6 ++++++ library/psa_crypto.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h index 0e2d57ce2c..56fe1d3036 100644 --- a/include/psa/crypto_extra.h +++ b/include/psa/crypto_extra.h @@ -1939,6 +1939,9 @@ psa_status_t psa_pake_abort(psa_pake_operation_t *operation); * * This macro must expand to a compile-time constant integer. * + * The value of this macro must be at least as large as the largest value + * returned by PSA_PAKE_OUTPUT_SIZE() + * * See also #PSA_PAKE_OUTPUT_SIZE(\p alg, \p primitive, \p step). */ #define PSA_PAKE_OUTPUT_MAX_SIZE 65 @@ -1948,6 +1951,9 @@ psa_status_t psa_pake_abort(psa_pake_operation_t *operation); * * This macro must expand to a compile-time constant integer. * + * The value of this macro must be at least as large as the largest value + * returned by PSA_PAKE_INPUT_SIZE() + * * See also #PSA_PAKE_INPUT_SIZE(\p alg, \p primitive, \p step). */ #define PSA_PAKE_INPUT_MAX_SIZE 65 diff --git a/library/psa_crypto.c b/library/psa_crypto.c index e2e0cb849d..e5a855bf40 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -7925,7 +7925,6 @@ psa_status_t psa_pake_input( goto exit; } - if (input_length == 0 || input_length > max_input_length) { status = PSA_ERROR_INVALID_ARGUMENT; goto exit;