Fix SHA definitions and their dependencies in library and test suites.

Rework SHA224 and SHA283 documentation.
Define MBEDTLS_SHAxxx_C options in alphabetic order.
Fix SHA224 and SHA384 dependencies in test suites.

Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
Mateusz Starzyk
2021-05-10 13:51:53 +02:00
parent e3c48b4a88
commit 6326a8dd37
24 changed files with 269 additions and 266 deletions

View File

@@ -48,8 +48,8 @@
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_MD_C
#define MBEDTLS_NET_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C

View File

@@ -56,8 +56,8 @@
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C

View File

@@ -73,10 +73,10 @@
#define MBEDTLS_PK_WRITE_C
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA384_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_VERSION_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C

View File

@@ -1249,17 +1249,6 @@
*/
//#define MBEDTLS_SHA256_SMALLER
/**
* \def MBEDTLS_SHA384_C
*
* Enable the SHA-384 option of the SHA-512 module.
*
* Requires: MBEDTLS_SHA512_C
*
* Comment to disable SHA-384
*/
#define MBEDTLS_SHA384_C
/**
* \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
*
@@ -2623,10 +2612,30 @@
*/
#define MBEDTLS_SHA1_C
/**
* \def MBEDTLS_SHA224_C
*
* Enable the SHA-224 cryptographic hash algorithm.
*
* Requires: MBEDTLS_SHA256_C. Library does not support enabling
* SHA-224 without SHA-256. Future version will have
* this option disabled by default.
*
* Module: library/sha256.c
* Caller: library/md.c
* library/ssl_cookie.c
*
* This module adds support for SHA-224.
*/
#define MBEDTLS_SHA224_C
/**
* \def MBEDTLS_SHA256_C
*
* Enable the SHA-256 cryptographic hash algorithms.
* Enable the SHA-256 cryptographic hash algorithm.
*
* Requires: MBEDTLS_SHA224_C. Library does not support enabling
* SHA-256 without SHA-224.
*
* Module: library/sha256.c
* Caller: library/entropy.c
@@ -2636,28 +2645,25 @@
* library/ssl_tls.c
*
* This module adds support for SHA-256.
* This module is required for SHA-244.
* This module is required for the SSL/TLS 1.2 PRF function.
*/
#define MBEDTLS_SHA256_C
/**
* \def MBEDTLS_SHA224_C
* \def MBEDTLS_SHA384_C
*
* Enable the SHA-224 cryptographic hash algorithms.
* Enable the SHA-384 cryptographic hash algorithm.
*
* Module: library/sha256.c
* Caller: library/entropy.c
* library/md.c
* Requires: MBEDTLS_SHA512_C
*
* Module: library/sha512.c
* Caller: library/md.c
* library/ssl_cli.c
* library/ssl_srv.c
* library/ssl_tls.c
*
* Requires: MBEDTLS_SHA256_C
* This module adds support for SHA-224.
* This module is required for the SSL/TLS 1.2 PRF function.
* Comment to disable SHA-384
*/
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA384_C
/**
* \def MBEDTLS_SHA512_C
@@ -2667,14 +2673,14 @@
* Module: library/sha512.c
* Caller: library/entropy.c
* library/md.c
* library/ssl_cli.c
* library/ssl_srv.c
* library/ssl_tls.c
* library/ssl_cookie.c
*
* This module adds support for SHA-512.
* This module is required for SHA-384.
*/
#define MBEDTLS_SHA512_C
/**
* \def MBEDTLS_SSL_CACHE_C
*

View File

@@ -63,10 +63,10 @@
#define MBEDTLS_OID_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA384_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C

View File

@@ -84,10 +84,10 @@
#define MBEDTLS_PSA_ITS_FILE_C
#define MBEDTLS_RIPEMD160_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA384_C
#define MBEDTLS_SHA512_C
//#define MBEDTLS_THREADING_C
#define MBEDTLS_TIMING_C
#define MBEDTLS_VERSION_C

View File

@@ -67,8 +67,8 @@
#define MBEDTLS_OID_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_COOKIE_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C