sha: fix minor issues/typos

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2022-12-22 14:25:26 +01:00
parent e7221a21ad
commit d10e0a6341
4 changed files with 13 additions and 4 deletions

View File

@ -178,6 +178,7 @@ int mbedtls_sha256( const unsigned char *input,
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_SHA224_C)
/**
* \brief The SHA-224 checkup routine.
*
@ -185,7 +186,9 @@ int mbedtls_sha256( const unsigned char *input,
* \return \c 1 on failure.
*/
int mbedtls_sha224_self_test( int verbose );
#endif /* MBEDTLS_SHA224_C */
#if defined(MBEDTLS_SHA256_C)
/**
* \brief The SHA-256 checkup routine.
*
@ -193,6 +196,7 @@ int mbedtls_sha224_self_test( int verbose );
* \return \c 1 on failure.
*/
int mbedtls_sha256_self_test( int verbose );
#endif /* MBEDTLS_SHA256_C */
#endif /* MBEDTLS_SELF_TEST */

View File

@ -195,6 +195,7 @@ int mbedtls_sha512( const unsigned char *input,
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_SHA384_C)
/**
* \brief The SHA-384 checkup routine.
*
@ -202,7 +203,9 @@ int mbedtls_sha512( const unsigned char *input,
* \return \c 1 on failure.
*/
int mbedtls_sha384_self_test( int verbose );
#endif /* MBEDTLS_SHA384_C */
#if defined(MBEDTLS_SHA512_C)
/**
* \brief The SHA-512 checkup routine.
*
@ -210,6 +213,8 @@ int mbedtls_sha384_self_test( int verbose );
* \return \c 1 on failure.
*/
int mbedtls_sha512_self_test( int verbose );
#endif /* MBEDTLS_SHA512_C */
#endif /* MBEDTLS_SELF_TEST */
#ifdef __cplusplus

View File

@ -18,7 +18,7 @@
defined(MBEDTLS_CTR_DRBG_C) && \
defined(MBEDTLS_TIMING_C) && \
( defined(MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA) || \
defined(MBEDTLS_HAS_ALG_SHA_224_VIA_MD_OR_PSA_BASED_ON_USE_PSA) )
defined(MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA_BASED_ON_USE_PSA) )
const char *pers = "fuzz_dtlsserver";
const unsigned char client_ip[4] = {0x7F, 0, 0, 1};
static int initialized = 0;
@ -36,7 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
defined(MBEDTLS_CTR_DRBG_C) && \
defined(MBEDTLS_TIMING_C) && \
( defined(MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA) || \
defined(MBEDTLS_HAS_ALG_SHA_224_VIA_MD_OR_PSA_BASED_ON_USE_PSA) )
defined(MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA_BASED_ON_USE_PSA) )
int ret;
size_t len;
mbedtls_ssl_context ssl;

View File

@ -244,13 +244,13 @@ const selftest_t selftests[] =
{"sha1", mbedtls_sha1_self_test},
#endif
#if defined(MBEDTLS_SHA224_C)
{"sha256", mbedtls_sha224_self_test},
{"sha224", mbedtls_sha224_self_test},
#endif
#if defined(MBEDTLS_SHA256_C)
{"sha256", mbedtls_sha256_self_test},
#endif
#if defined(MBEDTLS_SHA384_C)
{"sha512", mbedtls_sha384_self_test},
{"sha384", mbedtls_sha384_self_test},
#endif
#if defined(MBEDTLS_SHA512_C)
{"sha512", mbedtls_sha512_self_test},