net: disable MBEDTLS in SPL

Building SPL fails with MBEDTLS enabled.
Currently we don't need it there.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
(cherry picked from commit c7401fc1d9)

[Conflict resolved: kept PHASE_ macro syntax instead of XPL_, kept mbedtls_options.h include instead of inline MBEDTLS_ALLOW_PRIVATE_ACCESS, sha256_csum_wd already exists in sha256_common.c]
This commit is contained in:
Heinrich Schuchardt
2024-12-06 12:37:09 +01:00
committed by Simon Glass
parent b93fdb389e
commit 4a99a84173
5 changed files with 22 additions and 11 deletions

View File

@@ -6,7 +6,9 @@
#ifndef _MD5_H
#define _MD5_H
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
#include <linux/kconfig.h>
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
#include <mbedtls/md5.h>
#endif
#include "compiler.h"
@@ -14,7 +16,7 @@
#define MD5_SUM_LEN 16
#define MD5_DEF_CHUNK_SZ 0x10000
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
typedef mbedtls_md5_context MD5Context;
#else
typedef struct MD5Context {

View File

@@ -1,9 +1,10 @@
#ifndef _SHA512_H
#define _SHA512_H
#include <linux/kconfig.h>
#include <linux/types.h>
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
#include <mbedtls/sha512.h>
#endif
@@ -16,7 +17,7 @@
#define CHUNKSZ_SHA384 (16 * 1024)
#define CHUNKSZ_SHA512 (16 * 1024)
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
typedef mbedtls_sha512_context sha384_context;
typedef mbedtls_sha512_context sha512_context;
#else

View File

@@ -5,6 +5,8 @@
#ifndef LWIP_UBOOT_LWIPOPTS_H
#define LWIP_UBOOT_LWIPOPTS_H
#include <linux/kconfig.h>
#if defined(CONFIG_LWIP_DEBUG)
#define LWIP_DEBUG 1
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
@@ -154,7 +156,7 @@
#define MEMP_MEM_INIT 1
#define MEM_LIBC_MALLOC 1
#if defined(CONFIG_MBEDTLS_LIB_TLS)
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_TLS)
#define LWIP_ALTCP 1
#define LWIP_ALTCP_TLS 1
#define LWIP_ALTCP_TLS_MBEDTLS 1

View File

@@ -272,14 +272,16 @@ md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16],
unsigned int chunk_sz)
{
MD5Context context;
#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
MD5Init(&context);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
#if !defined(USE_HOSTCC) && \
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
curr = input;
end = input + len;
while (curr < end) {

View File

@@ -288,7 +288,8 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha512_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;
unsigned char *curr;
int chunk;
@@ -296,7 +297,8 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
sha384_starts(&ctx);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
#if !defined(USE_HOSTCC) && \
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {
@@ -351,7 +353,8 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha512_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;
unsigned char *curr;
int chunk;
@@ -359,7 +362,8 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
sha512_starts(&ctx);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
#if !defined(USE_HOSTCC) && \
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {