Merge remote-tracking branch 'public/pr/2932' into baremetal
This commit is contained in:
commit
5b45c6e1b3
11 changed files with 22 additions and 24 deletions
|
@ -185,7 +185,10 @@ endif(ENABLE_ZLIB_SUPPORT)
|
||||||
|
|
||||||
add_subdirectory(library)
|
add_subdirectory(library)
|
||||||
add_subdirectory(include)
|
add_subdirectory(include)
|
||||||
|
|
||||||
|
if(USE_TINYCRYPT)
|
||||||
add_subdirectory(tinycrypt)
|
add_subdirectory(tinycrypt)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_PROGRAMS)
|
if(ENABLE_PROGRAMS)
|
||||||
add_subdirectory(programs)
|
add_subdirectory(programs)
|
||||||
|
|
|
@ -73,7 +73,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
|
||||||
#ifndef __TC_UECC_H__
|
#ifndef __TC_UECC_H__
|
||||||
#define __TC_UECC_H__
|
#define __TC_UECC_H__
|
||||||
|
|
||||||
|
@ -535,4 +534,3 @@ void uECC_vli_bytesToNative(unsigned int *native, const uint8_t *bytes,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __TC_UECC_H__ */
|
#endif /* __TC_UECC_H__ */
|
||||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
|
||||||
|
|
|
@ -71,7 +71,6 @@
|
||||||
* Security: The curve NIST p-256 provides approximately 128 bits of security.
|
* Security: The curve NIST p-256 provides approximately 128 bits of security.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
|
||||||
#ifndef __TC_ECC_DH_H__
|
#ifndef __TC_ECC_DH_H__
|
||||||
#define __TC_ECC_DH_H__
|
#define __TC_ECC_DH_H__
|
||||||
|
|
||||||
|
@ -135,4 +134,3 @@ int uECC_shared_secret(const uint8_t *p_public_key, const uint8_t *p_private_key
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __TC_ECC_DH_H__ */
|
#endif /* __TC_ECC_DH_H__ */
|
||||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
|
||||||
|
|
|
@ -80,7 +80,6 @@
|
||||||
* the signer's public key and the signature values (r and s).
|
* the signer's public key and the signature values (r and s).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
|
||||||
#ifndef __TC_ECC_DSA_H__
|
#ifndef __TC_ECC_DSA_H__
|
||||||
#define __TC_ECC_DSA_H__
|
#define __TC_ECC_DSA_H__
|
||||||
|
|
||||||
|
@ -143,4 +142,3 @@ int uECC_verify(const uint8_t *p_public_key, const uint8_t *p_message_hash,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __TC_ECC_DSA_H__ */
|
#endif /* __TC_ECC_DSA_H__ */
|
||||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON)
|
option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON)
|
||||||
|
option(USE_TINYCRYPT "Include TinyCrypt." ON)
|
||||||
option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF)
|
option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF)
|
||||||
option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF)
|
option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF)
|
||||||
|
|
||||||
|
@ -123,7 +124,9 @@ if(LINK_WITH_PTHREAD)
|
||||||
set(libs ${libs} pthread)
|
set(libs ${libs} pthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_TINYCRYPT)
|
||||||
set(libs ${libs} tinycrypt)
|
set(libs ${libs} tinycrypt)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
|
if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
|
||||||
message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
|
message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
|
||||||
|
|
|
@ -99,8 +99,7 @@ OBJS_CRYPTO= aes.o aesni.o arc4.o \
|
||||||
ripemd160.o rsa_internal.o rsa.o \
|
ripemd160.o rsa_internal.o rsa.o \
|
||||||
sha1.o sha256.o sha512.o \
|
sha1.o sha256.o sha512.o \
|
||||||
threading.o timing.o version.o \
|
threading.o timing.o version.o \
|
||||||
version_features.o xtea.o \
|
version_features.o xtea.o
|
||||||
ecc.o ecc_dh.o ecc_dsa.o
|
|
||||||
|
|
||||||
OBJS_X509= certs.o pkcs11.o x509.o
|
OBJS_X509= certs.o pkcs11.o x509.o
|
||||||
|
|
||||||
|
@ -110,6 +109,17 @@ OBJS_TLS= debug.o net_sockets.o \
|
||||||
ssl_srv.o ssl_ticket.o \
|
ssl_srv.o ssl_ticket.o \
|
||||||
ssl_tls.o
|
ssl_tls.o
|
||||||
|
|
||||||
|
# Default to always build TinyCrypt
|
||||||
|
ifndef TINYCRYPT_BUILD
|
||||||
|
TINYCRYPT_BUILD=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TINYCRYPT_BUILD),1)
|
||||||
|
# Add TinyCrypt to the targets and Makefile path
|
||||||
|
VPATH = ../tinycrypt
|
||||||
|
OBJS_CRYPTO += ecc.o ecc_dh.o ecc_dsa.o
|
||||||
|
endif
|
||||||
|
|
||||||
.SILENT:
|
.SILENT:
|
||||||
|
|
||||||
.PHONY: all static shared clean
|
.PHONY: all static shared clean
|
||||||
|
|
|
@ -1491,7 +1491,7 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
|
||||||
msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
|
msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
|
||||||
scripts/config.pl baremetal
|
scripts/config.pl baremetal
|
||||||
scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
|
scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
|
||||||
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
|
make TINYCRYPT_BUILD=0 CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
|
||||||
echo "Checking that software 64-bit multiplication is not required"
|
echo "Checking that software 64-bit multiplication is not required"
|
||||||
if_build_succeeded not grep __aeabi_lmul library/*.o
|
if_build_succeeded not grep __aeabi_lmul library/*.o
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ cp include/mbedtls/config.h include/mbedtls/config.h.bak
|
||||||
scripts/config.pl full
|
scripts/config.pl full
|
||||||
make clean
|
make clean
|
||||||
make_ret=
|
make_ret=
|
||||||
CFLAGS=-fno-asynchronous-unwind-tables make lib \
|
CFLAGS=-fno-asynchronous-unwind-tables TINYCRYPT_BUILD=0 make lib \
|
||||||
>list-symbols.make.log 2>&1 ||
|
>list-symbols.make.log 2>&1 ||
|
||||||
{
|
{
|
||||||
make_ret=$?
|
make_ret=$?
|
||||||
|
|
|
@ -63,7 +63,6 @@
|
||||||
#include MBEDTLS_CONFIG_FILE
|
#include MBEDTLS_CONFIG_FILE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
|
||||||
#include <tinycrypt/ecc.h>
|
#include <tinycrypt/ecc.h>
|
||||||
#include "mbedtls/platform_util.h"
|
#include "mbedtls/platform_util.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -1114,7 +1113,4 @@ int uECC_compute_public_key(const uint8_t *private_key, uint8_t *public_key,
|
||||||
curve->num_bytes, curve->num_bytes, _public + curve->num_words);
|
curve->num_bytes, curve->num_bytes, _public + curve->num_words);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
typedef int mbedtls_dummy_tinycrypt_def;
|
|
||||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
#include MBEDTLS_CONFIG_FILE
|
#include MBEDTLS_CONFIG_FILE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
|
||||||
#include <tinycrypt/ecc.h>
|
#include <tinycrypt/ecc.h>
|
||||||
#include <tinycrypt/ecc_dh.h>
|
#include <tinycrypt/ecc_dh.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -188,6 +187,3 @@ clear_and_out:
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
typedef int mbedtls_dummy_tinycrypt_def;
|
|
||||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
#include MBEDTLS_CONFIG_FILE
|
#include MBEDTLS_CONFIG_FILE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
|
||||||
#include <tinycrypt/ecc.h>
|
#include <tinycrypt/ecc.h>
|
||||||
#include <tinycrypt/ecc_dsa.h>
|
#include <tinycrypt/ecc_dsa.h>
|
||||||
#include "mbedtls/platform_util.h"
|
#include "mbedtls/platform_util.h"
|
||||||
|
@ -316,6 +315,3 @@ int uECC_verify(const uint8_t *public_key, const uint8_t *message_hash,
|
||||||
|
|
||||||
return UECC_FAILURE;
|
return UECC_FAILURE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
typedef int mbedtls_dummy_tinycrypt_def;
|
|
||||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue