mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 16:01:27 +00:00
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>
This commit is contained in:
parent
1ac2838350
commit
c7401fc1d9
11 changed files with 38 additions and 21 deletions
|
@ -6,7 +6,9 @@
|
||||||
#ifndef _MD5_H
|
#ifndef _MD5_H
|
||||||
#define _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>
|
#include <mbedtls/md5.h>
|
||||||
#endif
|
#endif
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
|
@ -14,7 +16,7 @@
|
||||||
#define MD5_SUM_LEN 16
|
#define MD5_SUM_LEN 16
|
||||||
#define MD5_DEF_CHUNK_SZ 0x10000
|
#define MD5_DEF_CHUNK_SZ 0x10000
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
|
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
|
||||||
typedef mbedtls_md5_context MD5Context;
|
typedef mbedtls_md5_context MD5Context;
|
||||||
#else
|
#else
|
||||||
typedef struct MD5Context {
|
typedef struct MD5Context {
|
||||||
|
|
|
@ -14,9 +14,10 @@
|
||||||
#ifndef _SHA1_H
|
#ifndef _SHA1_H
|
||||||
#define _SHA1_H
|
#define _SHA1_H
|
||||||
|
|
||||||
|
#include <linux/kconfig.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
|
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
|
||||||
/*
|
/*
|
||||||
* FIXME:
|
* FIXME:
|
||||||
* MbedTLS define the members of "mbedtls_sha256_context" as private,
|
* MbedTLS define the members of "mbedtls_sha256_context" as private,
|
||||||
|
@ -47,7 +48,7 @@ extern "C" {
|
||||||
|
|
||||||
extern const uint8_t sha1_der_prefix[];
|
extern const uint8_t sha1_der_prefix[];
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
|
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
|
||||||
typedef mbedtls_sha1_context sha1_context;
|
typedef mbedtls_sha1_context sha1_context;
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#ifndef _SHA256_H
|
#ifndef _SHA256_H
|
||||||
#define _SHA256_H
|
#define _SHA256_H
|
||||||
|
|
||||||
|
#include <linux/kconfig.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
|
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
|
||||||
/*
|
/*
|
||||||
* FIXME:
|
* FIXME:
|
||||||
* MbedTLS define the members of "mbedtls_sha256_context" as private,
|
* MbedTLS define the members of "mbedtls_sha256_context" as private,
|
||||||
|
@ -27,7 +28,7 @@ extern const uint8_t sha256_der_prefix[];
|
||||||
/* Reset watchdog each time we process this many bytes */
|
/* Reset watchdog each time we process this many bytes */
|
||||||
#define CHUNKSZ_SHA256 (64 * 1024)
|
#define CHUNKSZ_SHA256 (64 * 1024)
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
|
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
|
||||||
typedef mbedtls_sha256_context sha256_context;
|
typedef mbedtls_sha256_context sha256_context;
|
||||||
#else
|
#else
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#ifndef _SHA512_H
|
#ifndef _SHA512_H
|
||||||
#define _SHA512_H
|
#define _SHA512_H
|
||||||
|
|
||||||
|
#include <linux/kconfig.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)
|
#if CONFIG_IS_ENABLED(MBEDTLS_LIB_CRYPTO)
|
||||||
#include <mbedtls/sha512.h>
|
#include <mbedtls/sha512.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@
|
||||||
#define CHUNKSZ_SHA384 (16 * 1024)
|
#define CHUNKSZ_SHA384 (16 * 1024)
|
||||||
#define CHUNKSZ_SHA512 (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 sha384_context;
|
||||||
typedef mbedtls_sha512_context sha512_context;
|
typedef mbedtls_sha512_context sha512_context;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -97,7 +97,7 @@ obj-$(CONFIG_LIBAVB) += libavb/
|
||||||
obj-$(CONFIG_$(PHASE_)OF_LIBFDT) += libfdt/
|
obj-$(CONFIG_$(PHASE_)OF_LIBFDT) += libfdt/
|
||||||
obj-$(CONFIG_$(PHASE_)OF_REAL) += fdtdec_common.o fdtdec.o
|
obj-$(CONFIG_$(PHASE_)OF_REAL) += fdtdec_common.o fdtdec.o
|
||||||
|
|
||||||
obj-$(CONFIG_MBEDTLS_LIB) += mbedtls/
|
obj-$(CONFIG_$(XPL_)MBEDTLS_LIB) += mbedtls/
|
||||||
|
|
||||||
obj-$(CONFIG_NET_LWIP) += lwip/
|
obj-$(CONFIG_NET_LWIP) += lwip/
|
||||||
|
|
||||||
|
|
|
@ -54,5 +54,5 @@ obj-y += \
|
||||||
lwip/src/core/udp.o \
|
lwip/src/core/udp.o \
|
||||||
lwip/src/netif/ethernet.o
|
lwip/src/netif/ethernet.o
|
||||||
|
|
||||||
obj-$(CONFIG_MBEDTLS_LIB_TLS) += lwip/src/apps/altcp_tls/altcp_tls_mbedtls.o \
|
obj-$(CONFIG_$(XPL_)MBEDTLS_LIB_TLS) += lwip/src/apps/altcp_tls/altcp_tls_mbedtls.o \
|
||||||
lwip/src/apps/altcp_tls/altcp_tls_mbedtls_mem.o
|
lwip/src/apps/altcp_tls/altcp_tls_mbedtls_mem.o
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#ifndef LWIP_UBOOT_LWIPOPTS_H
|
#ifndef LWIP_UBOOT_LWIPOPTS_H
|
||||||
#define LWIP_UBOOT_LWIPOPTS_H
|
#define LWIP_UBOOT_LWIPOPTS_H
|
||||||
|
|
||||||
|
#include <linux/kconfig.h>
|
||||||
|
|
||||||
#if defined(CONFIG_LWIP_DEBUG)
|
#if defined(CONFIG_LWIP_DEBUG)
|
||||||
#define LWIP_DEBUG 1
|
#define LWIP_DEBUG 1
|
||||||
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
||||||
|
@ -154,7 +156,7 @@
|
||||||
#define MEMP_MEM_INIT 1
|
#define MEMP_MEM_INIT 1
|
||||||
#define MEM_LIBC_MALLOC 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 1
|
||||||
#define LWIP_ALTCP_TLS 1
|
#define LWIP_ALTCP_TLS 1
|
||||||
#define LWIP_ALTCP_TLS_MBEDTLS 1
|
#define LWIP_ALTCP_TLS_MBEDTLS 1
|
||||||
|
|
|
@ -272,14 +272,16 @@ md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16],
|
||||||
unsigned int chunk_sz)
|
unsigned int chunk_sz)
|
||||||
{
|
{
|
||||||
MD5Context context;
|
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;
|
const unsigned char *end, *curr;
|
||||||
int chunk;
|
int chunk;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MD5Init(&context);
|
MD5Init(&context);
|
||||||
|
|
||||||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
|
#if !defined(USE_HOSTCC) && \
|
||||||
|
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
|
||||||
curr = input;
|
curr = input;
|
||||||
end = input + len;
|
end = input + len;
|
||||||
while (curr < end) {
|
while (curr < end) {
|
||||||
|
|
|
@ -312,14 +312,16 @@ void sha1_csum_wd(const unsigned char *input, unsigned int ilen,
|
||||||
unsigned char *output, unsigned int chunk_sz)
|
unsigned char *output, unsigned int chunk_sz)
|
||||||
{
|
{
|
||||||
sha1_context ctx;
|
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;
|
const unsigned char *end, *curr;
|
||||||
int chunk;
|
int chunk;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sha1_starts (&ctx);
|
sha1_starts (&ctx);
|
||||||
|
|
||||||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
|
#if !defined(USE_HOSTCC) && \
|
||||||
|
(defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG))
|
||||||
curr = input;
|
curr = input;
|
||||||
end = input + ilen;
|
end = input + ilen;
|
||||||
while (curr < end) {
|
while (curr < end) {
|
||||||
|
|
|
@ -273,7 +273,8 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
|
||||||
unsigned char *output, unsigned int chunk_sz)
|
unsigned char *output, unsigned int chunk_sz)
|
||||||
{
|
{
|
||||||
sha256_context ctx;
|
sha256_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;
|
const unsigned char *end;
|
||||||
unsigned char *curr;
|
unsigned char *curr;
|
||||||
int chunk;
|
int chunk;
|
||||||
|
@ -281,7 +282,8 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
|
||||||
|
|
||||||
sha256_starts(&ctx);
|
sha256_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;
|
curr = (unsigned char *)input;
|
||||||
end = input + ilen;
|
end = input + ilen;
|
||||||
while (curr < end) {
|
while (curr < end) {
|
||||||
|
|
12
lib/sha512.c
12
lib/sha512.c
|
@ -288,7 +288,8 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
|
||||||
unsigned char *output, unsigned int chunk_sz)
|
unsigned char *output, unsigned int chunk_sz)
|
||||||
{
|
{
|
||||||
sha512_context ctx;
|
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;
|
const unsigned char *end;
|
||||||
unsigned char *curr;
|
unsigned char *curr;
|
||||||
int chunk;
|
int chunk;
|
||||||
|
@ -296,7 +297,8 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
|
||||||
|
|
||||||
sha384_starts(&ctx);
|
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;
|
curr = (unsigned char *)input;
|
||||||
end = input + ilen;
|
end = input + ilen;
|
||||||
while (curr < end) {
|
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)
|
unsigned char *output, unsigned int chunk_sz)
|
||||||
{
|
{
|
||||||
sha512_context ctx;
|
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;
|
const unsigned char *end;
|
||||||
unsigned char *curr;
|
unsigned char *curr;
|
||||||
int chunk;
|
int chunk;
|
||||||
|
@ -359,7 +362,8 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
|
||||||
|
|
||||||
sha512_starts(&ctx);
|
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;
|
curr = (unsigned char *)input;
|
||||||
end = input + ilen;
|
end = input + ilen;
|
||||||
while (curr < end) {
|
while (curr < end) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue