From 8c776449065bcffbf013973dd4ef32d580a5cff0 Mon Sep 17 00:00:00 2001 From: "harshal.patil" Date: Fri, 7 Apr 2023 16:17:16 +0530 Subject: [PATCH] ecdsa: fix `-missing-prototypes` warning when `MBEDTLS_ECDSA_SIGN_ALT` is defined - In `mbedtls/v3.4.0`, ECDSA restartable sign and verify functions (`ecdsa.c`) were made public. - But the `mbedtls_ecdsa_sign_det_restartable` function prototype was declared in the file `ecdsa.h`, only when `MBEDTLS_ECDSA_SIGN_ALT` is not defined. Signed-off-by: harshal.patil --- ...ration-of-mbedtls_ecdsa_sign_det_restartable-function.txt | 5 +++++ include/mbedtls/ecdsa.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 ChangeLog.d/fix-declaration-of-mbedtls_ecdsa_sign_det_restartable-function.txt diff --git a/ChangeLog.d/fix-declaration-of-mbedtls_ecdsa_sign_det_restartable-function.txt b/ChangeLog.d/fix-declaration-of-mbedtls_ecdsa_sign_det_restartable-function.txt new file mode 100644 index 000000000..c30e07451 --- /dev/null +++ b/ChangeLog.d/fix-declaration-of-mbedtls_ecdsa_sign_det_restartable-function.txt @@ -0,0 +1,5 @@ +Bugfix + * Fix declaration of mbedtls_ecdsa_sign_det_restartable() function + in the ecdsa.h header file. There was a build warning when the + configuration macro MBEDTLS_ECDSA_SIGN_ALT was defined. + Resolves #7407. diff --git a/include/mbedtls/ecdsa.h b/include/mbedtls/ecdsa.h index c5d9701f6..e797c1a2f 100644 --- a/include/mbedtls/ecdsa.h +++ b/include/mbedtls/ecdsa.h @@ -288,6 +288,8 @@ int mbedtls_ecdsa_sign_restartable( void *p_rng_blind, mbedtls_ecdsa_restart_ctx *rs_ctx); +#endif /* !MBEDTLS_ECDSA_SIGN_ALT */ + #if defined(MBEDTLS_ECDSA_DETERMINISTIC) /** @@ -321,6 +323,7 @@ int mbedtls_ecdsa_sign_restartable( * buffer of length \p blen Bytes. It may be \c NULL if * \p blen is zero. * \param blen The length of \p buf in Bytes. + * \param md_alg The hash algorithm used to hash the original data. * \param f_rng_blind The RNG function used for blinding. This must not be * \c NULL. * \param p_rng_blind The RNG context to be passed to \p f_rng. This may be @@ -348,8 +351,6 @@ int mbedtls_ecdsa_sign_det_restartable( #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ -#endif /* !MBEDTLS_ECDSA_SIGN_ALT */ - /** * \brief This function verifies the ECDSA signature of a * previously-hashed message.