mbedtls: access mbedtls private members in mscode and pkcs7 parser

U-Boot requires to access x509_internal.h, mbedtls_sha256_context and
mbedtls_sha1_context in the porting layer, and this requires to
enable MBEDTLS_ALLOW_PRIVATE_ACCESS.

Enable it to mscode and pkcs7_parser to fix a mbedtls internal building
error when X509 is selected.

Moreover, Move it to a separate file to avoid enabling it in multiple
places.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Raymond Mao
2025-02-03 14:08:13 -08:00
committed by Simon Glass
parent 47f6c36d2d
commit 8fb478b7c4
6 changed files with 61 additions and 28 deletions

View File

@@ -312,14 +312,16 @@ void sha1_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha1_context ctx;
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
#if !defined(USE_HOSTCC) && \
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
const unsigned char *end, *curr;
int chunk;
#endif
sha1_starts (&ctx);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
#if !defined(USE_HOSTCC) && \
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
curr = input;
end = input + ilen;
while (curr < end) {